+ <.form
+ let={f}
+ for={@changeset}
+ ,
id="ammo_group-form"
phx-target={@myself}
phx-change="validate"
diff --git a/lib/cannery_web/live/ammo_type_live/form_component.ex b/lib/cannery_web/live/ammo_type_live/form_component.ex
index e4dad09c..2cd5cbfa 100644
--- a/lib/cannery_web/live/ammo_type_live/form_component.ex
+++ b/lib/cannery_web/live/ammo_type_live/form_component.ex
@@ -31,9 +31,12 @@ defmodule CanneryWeb.AmmoTypeLive.FormComponent do
def render(assigns) do
~H"""
-
<%= @title %>
-
- <.form let={f} for={@changeset}
+
+ <%= @title %>
+
+ <.form
+ let={f}
+ for={@changeset}
id="ammo_type-form"
phx-target={@myself}
phx-change="validate"
diff --git a/lib/cannery_web/live/container_live/form_component.ex b/lib/cannery_web/live/container_live/form_component.ex
index 83215e52..9e0ea90b 100644
--- a/lib/cannery_web/live/container_live/form_component.ex
+++ b/lib/cannery_web/live/container_live/form_component.ex
@@ -31,9 +31,12 @@ defmodule CanneryWeb.ContainerLive.FormComponent do
def render(assigns) do
~H"""
-
<%= @title %>
-
- <.form let={f} for={@changeset}
+
+ <%= @title %>
+
+ <.form
+ let={f}
+ for={@changeset}
id="container-form"
phx-target={@myself}
phx-change="validate"
diff --git a/lib/cannery_web/live/invite_live/form_component.ex b/lib/cannery_web/live/invite_live/form_component.ex
index 685f5156..b5f8a679 100644
--- a/lib/cannery_web/live/invite_live/form_component.ex
+++ b/lib/cannery_web/live/invite_live/form_component.ex
@@ -34,8 +34,9 @@ defmodule CanneryWeb.InviteLive.FormComponent do
<%= @title %>
-
- <.form let={f} for={@changeset}
+ <.form
+ let={f}
+ for={@changeset}
id="invite-form"
class="grid grid-cols-3 justify-center items-center space-y-4"
phx-target={@myself}
@@ -45,17 +46,17 @@ defmodule CanneryWeb.InviteLive.FormComponent do
<%= label f, :name, class: "title text-lg text-primary-500" %>
<%= text_input f, :name, class: "input input-primary col-span-2" %>
- <%= error_tag f, :name %>
+ <%= error_tag(f, :name) %>
-
- <%= label f, :uses_left, class: "title text-lg text-primary-500" %>
- <%= number_input f, :uses_left, min: 0, class: "input input-primary col-span-2" %>
+ <%= label(f, :uses_left, class: "title text-lg text-primary-500") %>
+ <%= number_input(f, :uses_left, min: 0, class: "input input-primary col-span-2") %>
- <%= error_tag f, :uses_left %>
+ <%= error_tag(f, :uses_left) %>
-
- <%= submit "Save", class: "mx-auto btn btn-primary col-span-3",
- phx_disable_with: "Saving..." %>
+ <%= submit("Save",
+ class: "mx-auto btn btn-primary col-span-3",
+ phx_disable_with: "Saving..."
+ ) %>
"""
@@ -71,7 +72,7 @@ defmodule CanneryWeb.InviteLive.FormComponent do
{:error, %Ecto.Changeset{} = changeset} ->
{:noreply, assign(socket, :changeset, changeset)}
- end
+ end
end
defp save_invite(socket, :new, invite_params) do
diff --git a/lib/cannery_web/live/live_helpers.ex b/lib/cannery_web/live/live_helpers.ex
index c9487a8e..6c6167a0 100644
--- a/lib/cannery_web/live/live_helpers.ex
+++ b/lib/cannery_web/live/live_helpers.ex
@@ -29,7 +29,7 @@ defmodule CanneryWeb.LiveHelpers do
Accounts.get_user_by_session_token(user_token)
end)
end
-
+
def assign_defaults(socket, _session) do
socket
end
diff --git a/lib/cannery_web/live/modal_component.ex b/lib/cannery_web/live/modal_component.ex
index 7fbe0581..2000bd50 100644
--- a/lib/cannery_web/live/modal_component.ex
+++ b/lib/cannery_web/live/modal_component.ex
@@ -4,7 +4,9 @@ defmodule CanneryWeb.ModalComponent do
@impl true
def render(assigns) do
~H"""
-
-
+ phx-page-loading
+ >
- <%# close button %>
<%= live_patch to: @return_to,
- class: "absolute top-8 right-10 text-gray-500 hover:text-gray-800
- transition-all duration-500 ease-in-out" do %>
-
+ class:
+ "absolute top-8 right-10 text-gray-500 hover:text-gray-800 transition-all duration-500 ease-in-out" do %>
+
+
<% end %>
-
- <%# modal content %>
- <%= live_component @component, @opts %>
+ <%= live_component(@component, @opts) %>
diff --git a/lib/cannery_web/live/tag_live/form_component.ex b/lib/cannery_web/live/tag_live/form_component.ex
index 3032e4ba..51d2162b 100644
--- a/lib/cannery_web/live/tag_live/form_component.ex
+++ b/lib/cannery_web/live/tag_live/form_component.ex
@@ -37,8 +37,9 @@ defmodule CanneryWeb.TagLive.FormComponent do
<%= @title %>
-
- <.form let={f} for={@changeset}
+ <.form
+ let={f}
+ for={@changeset}
id="tag-form"
class="grid grid-cols-3 justify-center items-center space-y-4"
phx-target={@myself}
@@ -48,27 +49,26 @@ defmodule CanneryWeb.TagLive.FormComponent do
<%= label f, :name, class: "title text-lg text-primary-500" %>
<%= text_input f, :name, class: "input input-primary col-span-2" %>
- <%= error_tag f, :name %>
+ <%= error_tag(f, :name) %>
-
- <%= label f, :bg_color, class: "title text-lg text-primary-500" %>
+ <%= label(f, :bg_color, class: "title text-lg text-primary-500") %>
- <%= color_input f, :bg_color, value: random_color() %>
+ <%= color_input(f, :bg_color, value: random_color()) %>
- <%= error_tag f, :bg_color %>
+ <%= error_tag(f, :bg_color) %>
-
- <%= label f, :text_color, class: "title text-lg text-primary-500" %>
+ <%= label(f, :text_color, class: "title text-lg text-primary-500") %>
- <%= color_input f, :text_color, value: "#ffffff" %>
+ <%= color_input(f, :text_color, value: "#ffffff") %>
- <%= error_tag f, :text_color %>
+ <%= error_tag(f, :text_color) %>
-
- <%= submit "Save", class: "mx-auto btn btn-primary col-span-3",
- phx_disable_with: "Saving..." %>
+ <%= submit("Save",
+ class: "mx-auto btn btn-primary col-span-3",
+ phx_disable_with: "Saving..."
+ ) %>
"""
diff --git a/lib/cannery_web/templates/layout/app.html.heex b/lib/cannery_web/templates/layout/app.html.heex
index f1f48725..5a7d89d9 100644
--- a/lib/cannery_web/templates/layout/app.html.heex
+++ b/lib/cannery_web/templates/layout/app.html.heex
@@ -1,21 +1,18 @@
diff --git a/lib/cannery_web/templates/layout/live.html.heex b/lib/cannery_web/templates/layout/live.html.heex
index 29b68703..77890279 100644
--- a/lib/cannery_web/templates/layout/live.html.heex
+++ b/lib/cannery_web/templates/layout/live.html.heex
@@ -1,28 +1,19 @@
-
diff --git a/lib/cannery_web/templates/layout/root.html.heex b/lib/cannery_web/templates/layout/root.html.heex
index b520a498..062796a1 100644
--- a/lib/cannery_web/templates/layout/root.html.heex
+++ b/lib/cannery_web/templates/layout/root.html.heex
@@ -1,13 +1,19 @@
-
<%= csrf_meta_tag() %>
- <%= live_title_tag assigns[:page_title] || "Cannery", suffix: "" %>
-
-
+ <%= live_title_tag(assigns[:page_title] || "Cannery", suffix: "") %>
+
+
<%= @inner_content %>
diff --git a/priv/repo/migrations/20210903015537_create_ammo_types.exs b/priv/repo/migrations/20210903015537_create_ammo_types.exs
index 22388412..aa9d6060 100644
--- a/priv/repo/migrations/20210903015537_create_ammo_types.exs
+++ b/priv/repo/migrations/20210903015537_create_ammo_types.exs
@@ -13,6 +13,5 @@ defmodule Cannery.Repo.Migrations.CreateAmmoTypes do
timestamps()
end
-
end
end