diff --git a/assets/css/components.scss b/assets/css/components.scss index 073febbf..bdfdf247 100644 --- a/assets/css/components.scss +++ b/assets/css/components.scss @@ -17,6 +17,8 @@ -o-transform: scale(1.5); transform: scale(1.5); padding: 10px; + margin-left: auto; + margin-right: auto; } .title { @@ -45,6 +47,10 @@ @apply border border-primary-300 w-full max-w-2xl; } + .hr-light { + @apply border border-white w-full max-w-2xl; + } + .link { @apply hover:underline; @apply transition-colors duration-500 ease-in-out; diff --git a/config/runtime.exs b/config/runtime.exs index c677da6a..bced4378 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -12,8 +12,7 @@ if System.get_env("PHX_SERVER") && System.get_env("RELEASE_NAME") do config :cannery, CanneryWeb.Endpoint, server: true end -config :cannery, CanneryWeb.ViewHelpers, - shibao_mode: System.get_env("SHIBAO_MODE") == "true" +config :cannery, CanneryWeb.ViewHelpers, shibao_mode: System.get_env("SHIBAO_MODE") == "true" # Set locale Gettext.put_locale(System.get_env("LOCALE") || "en_US") diff --git a/lib/cannery_web/components/add_shot_group_component.html.heex b/lib/cannery_web/components/add_shot_group_component.html.heex index d079472a..dc4f9085 100644 --- a/lib/cannery_web/components/add_shot_group_component.html.heex +++ b/lib/cannery_web/components/add_shot_group_component.html.heex @@ -7,7 +7,7 @@ let={f} for={@changeset} id="shot-group-form" - class="grid grid-cols-3 justify-center items-center space-y-4" + class="flex flex-col sm:grid sm:grid-cols-3 justify-center items-center space-y-4" phx-target={@myself} phx-change="validate" phx-submit="save" diff --git a/lib/cannery_web/components/invite_card.ex b/lib/cannery_web/components/invite_card.ex index f293f887..ed8aac07 100644 --- a/lib/cannery_web/components/invite_card.ex +++ b/lib/cannery_web/components/invite_card.ex @@ -26,8 +26,11 @@ defmodule CanneryWeb.Components.InviteCard do <% end %> -
<%= Routes.user_registration_url(Endpoint, :new, invite: @invite.token) %>
+
+ <%= Routes.user_registration_url(Endpoint, :new, invite: @invite.token) %>
<%= if @code_actions do %>
diff --git a/lib/cannery_web/components/move_ammo_group_component.html.heex b/lib/cannery_web/components/move_ammo_group_component.html.heex
index 8796e984..0637c768 100644
--- a/lib/cannery_web/components/move_ammo_group_component.html.heex
+++ b/lib/cannery_web/components/move_ammo_group_component.html.heex
@@ -5,7 +5,8 @@
<%= if @containers |> Enum.empty?() do %>
- <%= gettext("No other containers") %> <%= display_emoji("😔") %>
+ <%= gettext("No other containers") %>
+ <%= display_emoji("😔") %>
<%= live_patch(dgettext("actions", "Add another container!"),
diff --git a/lib/cannery_web/components/topbar.ex b/lib/cannery_web/components/topbar.ex
index 36b043a0..a9ee062d 100644
--- a/lib/cannery_web/components/topbar.ex
+++ b/lib/cannery_web/components/topbar.ex
@@ -13,102 +13,105 @@ defmodule CanneryWeb.Components.Topbar do
%{results: [], title_content: nil, flash: nil, current_user: nil} |> Map.merge(assigns)
~H"""
-
-
"""
end
end
diff --git a/lib/cannery_web/components/user_card.ex b/lib/cannery_web/components/user_card.ex
index 6b3518ad..c44155fb 100644
--- a/lib/cannery_web/components/user_card.ex
+++ b/lib/cannery_web/components/user_card.ex
@@ -13,7 +13,7 @@ defmodule CanneryWeb.Components.UserCard do
border border-gray-400 rounded-lg shadow-lg hover:shadow-md
transition-all duration-300 ease-in-out"
>
-
+
<%= @user.email %>
diff --git a/lib/cannery_web/live/ammo_group_live/form_component.html.heex b/lib/cannery_web/live/ammo_group_live/form_component.html.heex
index 5baee65b..af9dce63 100644
--- a/lib/cannery_web/live/ammo_group_live/form_component.html.heex
+++ b/lib/cannery_web/live/ammo_group_live/form_component.html.heex
@@ -10,7 +10,7 @@
phx-target={@myself}
phx-change="validate"
phx-submit="save"
- class="grid grid-cols-3 justify-center items-center space-y-4"
+ class="flex flex-col sm:grid sm:grid-cols-3 justify-center items-center space-y-4"
>
<%= if @changeset.action && not @changeset.valid? do %>
diff --git a/lib/cannery_web/live/ammo_group_live/index.html.heex b/lib/cannery_web/live/ammo_group_live/index.html.heex
index 2151d6cc..0c5b65de 100644
--- a/lib/cannery_web/live/ammo_group_live/index.html.heex
+++ b/lib/cannery_web/live/ammo_group_live/index.html.heex
@@ -1,11 +1,12 @@
-
+
<%= gettext("Ammo") %>
<%= if @ammo_groups |> Enum.empty?() do %>
- <%= gettext("No Ammo") %> <%= display_emoji("😔") %>
+ <%= gettext("No Ammo") %>
+ <%= display_emoji("😔") %>
<%= live_patch(dgettext("actions", "Add your first box!"),
@@ -35,7 +36,7 @@
<%= gettext("Notes") %>
- <%= gettext("Staging") %>
+ <%= gettext("Staged for Range") %>
<%= gettext("Container") %>
@@ -75,7 +76,7 @@
phx-click="toggle_staged"
phx-value-ammo_group_id={ammo_group.id}
>
- <%= if ammo_group.staged, do: gettext("Unstage from range"), else: gettext("Stage for range") %>
+ <%= if ammo_group.staged, do: gettext("Unstage"), else: gettext("Stage") %>
@@ -88,7 +89,7 @@
<% end %>
-
+
<%= live_redirect to: Routes.ammo_group_show_path(@socket, :show, ammo_group),
class: "text-primary-500 link" do %>
diff --git a/lib/cannery_web/live/ammo_group_live/show.html.heex b/lib/cannery_web/live/ammo_group_live/show.html.heex
index 33c4525a..ae31e1ae 100644
--- a/lib/cannery_web/live/ammo_group_live/show.html.heex
+++ b/lib/cannery_web/live/ammo_group_live/show.html.heex
@@ -24,25 +24,25 @@
<% end %>
-
+
<%= live_patch(dgettext("actions", "Ammo Details"),
to: Routes.ammo_type_show_path(Endpoint, :show, @ammo_group.ammo_type),
- class: "btn btn-primary"
+ class: "mx-4 my-2 btn btn-primary"
) %>
<%= live_patch to: Routes.ammo_group_show_path(Endpoint, :edit, @ammo_group),
- class: "text-primary-500 link" do %>
+ class: "mx-4 my-2 text-primary-500 link" do %>
<% end %>
<%= link to: "#",
- class: "text-primary-500 link",
+ class: "mx-4 my-2 text-primary-500 link",
phx_click: "delete",
data: [confirm: dgettext("prompts", "Are you sure you want to delete this ammo?")] do %>
<% end %>
-
- <%= live_patch to: Routes.range_index_path(Endpoint, :edit, shot_group),
- class: "text-primary-500 link" do %>
-
- <% end %>
+
+ <%= live_patch to: Routes.range_index_path(Endpoint, :edit, shot_group),
+ class: "text-primary-500 link" do %>
+
+ <% end %>
- <%= link to: "#",
- class: "text-primary-500 link",
- phx_click: "delete",
- phx_value_id: shot_group.id,
- data: [confirm: dgettext("prompts", "Are you sure you want to delete this shot record?")] do %>
-
- <% end %>
+ <%= link to: "#",
+ class: "text-primary-500 link",
+ phx_click: "delete",
+ phx_value_id: shot_group.id,
+ data: [confirm: dgettext("prompts", "Are you sure you want to delete this shot record?")] do %>
+
+ <% end %>
+
<% end %>
diff --git a/lib/cannery_web/live/tag_live/form_component.ex b/lib/cannery_web/live/tag_live/form_component.ex
index dd1122f9..718ada09 100644
--- a/lib/cannery_web/live/tag_live/form_component.ex
+++ b/lib/cannery_web/live/tag_live/form_component.ex
@@ -36,7 +36,7 @@ defmodule CanneryWeb.TagLive.FormComponent do
let={f}
for={@changeset}
id="tag-form"
- class="grid grid-cols-3 justify-center items-center space-y-4"
+ class="flex flex-col sm:grid sm:grid-cols-3 justify-center items-center space-y-4"
phx-target={@myself}
phx-change="validate"
phx-submit="save"
diff --git a/lib/cannery_web/live/tag_live/index.html.heex b/lib/cannery_web/live/tag_live/index.html.heex
index a3313839..a0a3b299 100644
--- a/lib/cannery_web/live/tag_live/index.html.heex
+++ b/lib/cannery_web/live/tag_live/index.html.heex
@@ -7,7 +7,8 @@
<%= if @tags |> Enum.empty?() do %>
- <%= gettext("No tags") %> <%= display_emoji("😔") %>
+ <%= gettext("No tags") %>
+ <%= display_emoji("😔") %>
<%= live_patch(dgettext("actions", "Make your first tag!"),
@@ -20,7 +21,7 @@
class: "btn btn-primary"
) %>
<% end %>
-
+
<%= for tag <- @tags do %>
<.tag_card tag={tag}>
<%= live_patch to: Routes.tag_index_path(Endpoint, :edit, tag),
diff --git a/lib/cannery_web/templates/layout/app.html.heex b/lib/cannery_web/templates/layout/app.html.heex
index 39732d36..4f498cbc 100644
--- a/lib/cannery_web/templates/layout/app.html.heex
+++ b/lib/cannery_web/templates/layout/app.html.heex
@@ -16,5 +16,7 @@
- <%= @inner_content %>
+
+ <%= @inner_content %>
+
diff --git a/lib/cannery_web/templates/layout/live.html.heex b/lib/cannery_web/templates/layout/live.html.heex
index 55f13aca..8c697a62 100644
--- a/lib/cannery_web/templates/layout/live.html.heex
+++ b/lib/cannery_web/templates/layout/live.html.heex
@@ -17,5 +17,7 @@
- <%= @inner_content %>
+
+ <%= @inner_content %>
+
diff --git a/lib/cannery_web/templates/user_confirmation/new.html.heex b/lib/cannery_web/templates/user_confirmation/new.html.heex
index 42b8ff62..972fc094 100644
--- a/lib/cannery_web/templates/user_confirmation/new.html.heex
+++ b/lib/cannery_web/templates/user_confirmation/new.html.heex
@@ -1,32 +1,33 @@
-
+
<%= dgettext("actions", "Resend confirmation instructions") %>
<%= form_for :user,
Routes.user_confirmation_path(@conn, :create),
- [class: "flex flex-col justify-center items-center space-y-4"],
+ [class: "flex flex-col sm:grid sm:grid-cols-3
+ justify-center items-center text-center space-y-4"],
fn f -> %>
-
- <%= label(f, :email, class: "title text-lg text-primary-500") %>
- <%= email_input(f, :email, required: true, class: "input input-primary col-span-2") %>
-
+ <%= label(f, :email, class: "title text-lg text-primary-500") %>
+ <%= email_input(f, :email, required: true, class: "input input-primary col-span-2") %>
- <%= submit(dgettext("actions", "Resend confirmation instructions"), class: "btn btn-primary") %>
+ <%= submit(dgettext("actions", "Resend confirmation instructions"),
+ class: "mx-auto my-4 btn btn-primary col-span-3"
+ ) %>
+ <% end %>
-
+
-
- <%= if Accounts.allow_registration?() do %>
- <%= link(dgettext("actions", "Register"),
- to: Routes.user_registration_path(@conn, :new),
- class: "btn btn-primary"
- ) %>
- <% end %>
- <%= link(dgettext("actions", "Log in"),
- to: Routes.user_session_path(@conn, :new),
+
+ <%= if Accounts.allow_registration?() do %>
+ <%= link(dgettext("actions", "Register"),
+ to: Routes.user_registration_path(@conn, :new),
class: "btn btn-primary"
) %>
-
- <% end %>
+ <% end %>
+ <%= link(dgettext("actions", "Log in"),
+ to: Routes.user_session_path(@conn, :new),
+ class: "btn btn-primary"
+ ) %>
+
diff --git a/lib/cannery_web/templates/user_registration/new.html.heex b/lib/cannery_web/templates/user_registration/new.html.heex
index e4b3a13c..4de3c3c6 100644
--- a/lib/cannery_web/templates/user_registration/new.html.heex
+++ b/lib/cannery_web/templates/user_registration/new.html.heex
@@ -1,14 +1,15 @@
-
+
<%= dgettext("actions", "Register") %>
<%= form_for @changeset,
Routes.user_registration_path(@conn, :create),
- [class: "flex flex-col justify-center items-center space-y-4"],
+ [class: "flex flex-col sm:grid sm:grid-cols-3
+ justify-center items-center text-center space-y-4"],
fn f -> %>
<%= if @changeset.action && not @changeset.valid? do %>
-
+
<%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %>
@@ -19,31 +20,27 @@
<%= hidden_input(f, :invite_token, value: @invite.token) %>
<% end %>
-
- <%= label(f, :email, class: "title text-lg text-primary-500") %>
- <%= email_input(f, :email, required: true, class: "input input-primary col-span-2") %>
-
- <%= error_tag(f, :email) %>
+ <%= label(f, :email, class: "title text-lg text-primary-500") %>
+ <%= email_input(f, :email, required: true, class: "input input-primary col-span-2") %>
+ <%= error_tag(f, :email, "col-span-3") %>
-
- <%= label(f, :password, class: "title text-lg text-primary-500") %>
- <%= password_input(f, :password, required: true, class: "input input-primary col-span-2") %>
-
- <%= error_tag(f, :password) %>
+ <%= label(f, :password, class: "title text-lg text-primary-500") %>
+ <%= password_input(f, :password, required: true, class: "input input-primary col-span-2") %>
+ <%= error_tag(f, :password, "col-span-3") %>
- <%= submit(dgettext("actions", "Register"), class: "btn btn-primary") %>
-
-
-
-
- <%= link(dgettext("actions", "Log in"),
- to: Routes.user_session_path(@conn, :new),
- class: "btn btn-primary"
- ) %>
- <%= link(dgettext("actions", "Forgot your password?"),
- to: Routes.user_reset_password_path(@conn, :new),
- class: "btn btn-primary"
- ) %>
-
+ <%= submit(dgettext("actions", "Register"), class: "mx-auto my-4 btn btn-primary col-span-3") %>
<% end %>
+
+
+
+
+ <%= link(dgettext("actions", "Log in"),
+ to: Routes.user_session_path(@conn, :new),
+ class: "btn btn-primary"
+ ) %>
+ <%= link(dgettext("actions", "Forgot your password?"),
+ to: Routes.user_reset_password_path(@conn, :new),
+ class: "btn btn-primary"
+ ) %>
+
diff --git a/lib/cannery_web/templates/user_reset_password/edit.html.heex b/lib/cannery_web/templates/user_reset_password/edit.html.heex
index 667a33bf..280c6866 100644
--- a/lib/cannery_web/templates/user_reset_password/edit.html.heex
+++ b/lib/cannery_web/templates/user_reset_password/edit.html.heex
@@ -1,47 +1,44 @@
-
+
<%= dgettext("actions", "Reset password") %>
<%= form_for @changeset,
Routes.user_reset_password_path(@conn, :update, @token),
- [class: "flex flex-col justify-center items-center space-y-4"],
+ [class: "flex flex-col sm:grid sm:grid-cols-3
+ justify-center items-center text-center space-y-4"],
fn f -> %>
<%= if @changeset.action && not @changeset.valid? do %>
-
+
<%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %>
<% end %>
-
- <%= label(f, :password, "New password", class: "title text-lg text-primary-500") %>
- <%= password_input(f, :password, required: true, class: "input input-primary col-span-2") %>
-
- <%= error_tag(f, :password) %>
+ <%= label(f, :password, "New password", class: "title text-lg text-primary-500") %>
+ <%= password_input(f, :password, required: true, class: "input input-primary col-span-2") %>
+ <%= error_tag(f, :password, "col-span-3") %>
-
- <%= label(f, :password_confirmation, "Confirm new password", class: "title text-lg text-primary-500") %>
- <%= password_input(f, :password_confirmation, required: true, class: "input input-primary col-span-2") %>
-
- <%= error_tag(f, :password_confirmation) %>
+ <%= label(f, :password_confirmation, "Confirm new password", class: "title text-lg text-primary-500") %>
+ <%= password_input(f, :password_confirmation, required: true, class: "input input-primary col-span-2") %>
+ <%= error_tag(f, :password_confirmation, "col-span-3") %>
- <%= submit(dgettext("actions", "Reset password"), class: "btn btn-primary") %>
+ <%= submit(dgettext("actions", "Reset password"), class: "mx-auto my-4 btn btn-primary col-span-3") %>
+ <% end %>
-
+
-
- <%= if Accounts.allow_registration?() do %>
- <%= link(dgettext("actions", "Register"),
- to: Routes.user_registration_path(@conn, :new),
- class: "btn btn-primary"
- ) %>
- <% end %>
- <%= link(dgettext("actions", "Log in"),
- to: Routes.user_session_path(@conn, :new),
+
+ <%= if Accounts.allow_registration?() do %>
+ <%= link(dgettext("actions", "Register"),
+ to: Routes.user_registration_path(@conn, :new),
class: "btn btn-primary"
) %>
-
- <% end %>
+ <% end %>
+ <%= link(dgettext("actions", "Log in"),
+ to: Routes.user_session_path(@conn, :new),
+ class: "btn btn-primary"
+ ) %>
+
diff --git a/lib/cannery_web/templates/user_reset_password/new.html.heex b/lib/cannery_web/templates/user_reset_password/new.html.heex
index 580525f6..623c0fe6 100644
--- a/lib/cannery_web/templates/user_reset_password/new.html.heex
+++ b/lib/cannery_web/templates/user_reset_password/new.html.heex
@@ -1,33 +1,34 @@
-
+
<%= dgettext("actions", "Forgot your password?") %>
<%= form_for :user,
Routes.user_reset_password_path(@conn, :create),
- [class: "flex flex-col justify-center items-center space-y-4"],
+ [class: "flex flex-col sm:grid sm:grid-cols-3
+ justify-center items-center text-center space-y-4"],
fn f -> %>
-
- <%= label(f, :email, class: "title text-lg text-primary-500") %>
- <%= email_input(f, :email, required: true, class: "input input-primary col-span-2") %>
-
+ <%= label(f, :email, class: "title text-lg text-primary-500") %>
+ <%= email_input(f, :email, required: true, class: "input input-primary col-span-2") %>
- <%= submit(dgettext("actions", "Send instructions to reset password"), class: "btn btn-primary") %>
+ <%= submit(dgettext("actions", "Send instructions to reset password"),
+ class: "mx-auto my-4 btn btn-primary col-span-3"
+ ) %>
+ <% end %>
-
+
-
- <%= if Accounts.allow_registration?() do %>
- <%= link(dgettext("actions", "Register"),
- to: Routes.user_registration_path(@conn, :new),
- class: "btn btn-primary"
- ) %>
- <% end %>
- <%= link(dgettext("actions", "Log in"),
- to: Routes.user_session_path(@conn, :new),
+
+ <%= if Accounts.allow_registration?() do %>
+ <%= link(dgettext("actions", "Register"),
+ to: Routes.user_registration_path(@conn, :new),
class: "btn btn-primary"
) %>
-
- <% end %>
+ <% end %>
+ <%= link(dgettext("actions", "Log in"),
+ to: Routes.user_session_path(@conn, :new),
+ class: "btn btn-primary"
+ ) %>
+
diff --git a/lib/cannery_web/templates/user_session/new.html.heex b/lib/cannery_web/templates/user_session/new.html.heex
index f0c2b810..6bd03788 100644
--- a/lib/cannery_web/templates/user_session/new.html.heex
+++ b/lib/cannery_web/templates/user_session/new.html.heex
@@ -1,52 +1,47 @@
-
+
<%= dgettext("actions", "Log in") %>
<%= form_for @conn,
Routes.user_session_path(@conn, :create),
- [as: :user, class: "flex flex-col justify-center items-center space-y-4"],
+ [as: :user, class: "flex flex-col sm:grid sm:grid-cols-3
+ justify-center items-center text-center space-y-4"],
fn f -> %>
<%= if @error_message do %>
-
+
<%= @error_message %>
<% end %>
-
- <%= label(f, :email, class: "title text-lg text-primary-500") %>
- <%= email_input(f, :email, required: true, class: "input input-primary col-span-2") %>
-
+ <%= label(f, :email, class: "title text-lg text-primary-500") %>
+ <%= email_input(f, :email, required: true, class: "input input-primary col-span-2") %>
-
- <%= label(f, :password, class: "title text-lg text-primary-500") %>
- <%= password_input(f, :password, required: true, class: "input input-primary col-span-2") %>
-
+ <%= label(f, :password, class: "title text-lg text-primary-500") %>
+ <%= password_input(f, :password, required: true, class: "input input-primary col-span-2") %>
-
- <%= label(f, :remember_me, gettext("Keep me logged in for 60 days"),
- class: "title text-lg text-primary-500"
- ) %>
- <%= checkbox(f, :remember_me, class: "checkbox") %>
-
+ <%= label(f, :remember_me, gettext("Keep me logged in for 60 days"),
+ class: "title text-lg text-primary-500"
+ ) %>
+ <%= checkbox(f, :remember_me, class: "checkbox col-span-2") %>
- <%= submit(dgettext("actions", "Log in"), class: "btn btn-primary") %>
+ <%= submit(dgettext("actions", "Log in"), class: "mx-auto my-4 btn btn-primary col-span-3") %>
+ <% end %>
-
+
-
- <%= if Accounts.allow_registration?() do %>
- <%= link(dgettext("actions", "Register"),
- to: Routes.user_registration_path(@conn, :new),
- class: "btn btn-primary"
- ) %>
- <% end %>
- <%= link(dgettext("actions", "Forgot your password?"),
- to: Routes.user_reset_password_path(@conn, :new),
+
+ <%= if Accounts.allow_registration?() do %>
+ <%= link(dgettext("actions", "Register"),
+ to: Routes.user_registration_path(@conn, :new),
class: "btn btn-primary"
) %>
-
- <% end %>
+ <% end %>
+ <%= link(dgettext("actions", "Forgot your password?"),
+ to: Routes.user_reset_password_path(@conn, :new),
+ class: "btn btn-primary"
+ ) %>
+
diff --git a/lib/cannery_web/templates/user_settings/edit.html.heex b/lib/cannery_web/templates/user_settings/edit.html.heex
index 4190ecf1..5dfbb897 100644
--- a/lib/cannery_web/templates/user_settings/edit.html.heex
+++ b/lib/cannery_web/templates/user_settings/edit.html.heex
@@ -1,18 +1,21 @@
-
-
+
+
<%= gettext("Settings") %>
-
- <%= dgettext("actions", "Change email") %>
-
+
<%= form_for @email_changeset,
Routes.user_settings_path(@conn, :update),
- [class: "flex flex-col justify-center items-center space-y-4"],
+ [class: "pb-4 flex flex-col sm:grid sm:grid-cols-3
+ justify-center items-center text-center space-y-4"],
fn f -> %>
- <%= if @email_changeset.action do %>
-
+
+ <%= dgettext("actions", "Change email") %>
+
+
+ <%= if @email_changeset.action && not @email_changeset.valid? do %>
+
<%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %>
@@ -21,39 +24,40 @@
<%= hidden_input(f, :action, name: "action", value: "update_email") %>
-
- <%= label(f, :email, class: "title text-lg text-primary-500") %>
- <%= email_input(f, :email, required: true, class: "input input-primary col-span-2") %>
-
- <%= error_tag(f, :email) %>
+ <%= label(f, :email, class: "title text-lg text-primary-500") %>
+ <%= email_input(f, :email, required: true, class: "mx-2 my-1 input input-primary col-span-2") %>
+ <%= error_tag(f, :email, "col-span-3") %>
-
- <%= label(f, :current_password,
- for: "current_password_for_email",
- class: "title text-lg text-primary-500"
- ) %>
- <%= password_input(f, :current_password,
- required: true,
- name: "current_password",
- id: "current_password_for_email",
- class: "input input-primary col-span-2"
- ) %>
-
- <%= error_tag(f, :current_password) %>
+ <%= label(f, :current_password, gettext("Current password"),
+ for: "current_password_for_email",
+ class: "mx-2 my-1 title text-lg text-primary-500"
+ ) %>
+ <%= password_input(f, :current_password,
+ required: true,
+ name: "current_password",
+ id: "current_password_for_email",
+ class: "mx-2 my-1 input input-primary col-span-2"
+ ) %>
+ <%= error_tag(f, :current_password, "col-span-3") %>
- <%= submit(dgettext("actions", "Change email"), class: "btn btn-primary") %>
+ <%= submit(dgettext("actions", "Change email"), class: "mx-auto my-4 btn btn-primary col-span-3") %>
<% end %>
-
- <%= dgettext("actions", "Change password") %>
-
+
<%= form_for @password_changeset,
Routes.user_settings_path(@conn, :update),
- [class: "flex flex-col justify-center items-center space-y-4"],
+ [
+ class:
+ "pb-4 flex flex-col sm:grid sm:grid-cols-3 justify-center items-center text-center space-y-4"
+ ],
fn f -> %>
- <%= if @password_changeset.action do %>
-
+
+ <%= dgettext("actions", "Change password") %>
+
+
+ <%= if @password_changeset.action && not @password_changeset.valid? do %>
+
<%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %>
@@ -62,41 +66,39 @@
<%= hidden_input(f, :action, name: "action", value: "update_password") %>
-
- <%= label(f, :password, "New password", class: "title text-lg text-primary-500") %>
- <%= password_input(f, :password,
- required: true,
- class: "input input-primary col-span-2"
- ) %>
-
- <%= error_tag(f, :password) %>
+ <%= label(f, :password, gettext("New password"), class: "title text-lg text-primary-500") %>
+ <%= password_input(f, :password,
+ required: true,
+ class: "mx-2 my-1 input input-primary col-span-2"
+ ) %>
+ <%= error_tag(f, :password, "col-span-3") %>
-
- <%= label(f, :password_confirmation, "Confirm new password", class: "title text-lg text-primary-500") %>
- <%= password_input(f, :password_confirmation,
- required: true,
- class: "input input-primary col-span-2"
- ) %>
-
- <%= error_tag(f, :password_confirmation) %>
+ <%= label(f, :password_confirmation, gettext("Confirm new password"),
+ class: "title text-lg text-primary-500"
+ ) %>
+ <%= password_input(f, :password_confirmation,
+ required: true,
+ class: "mx-2 my-1 input input-primary col-span-2"
+ ) %>
+ <%= error_tag(f, :password_confirmation, "col-span-3") %>
-
- <%= label(f, :current_password,
- for: "current_password_for_password",
- class: "title text-lg text-primary-500"
- ) %>
- <%= password_input(f, :current_password,
- required: true,
- name: "current_password",
- id: "current_password_for_password",
- class: "input input-primary col-span-2"
- ) %>
-
- <%= error_tag(f, :current_password) %>
+ <%= label(f, :current_password, gettext("Current password"),
+ for: "current_password_for_password",
+ class: "title text-lg text-primary-500"
+ ) %>
+ <%= password_input(f, :current_password,
+ required: true,
+ name: "current_password",
+ id: "current_password_for_password",
+ class: "mx-2 my-1 input input-primary col-span-2"
+ ) %>
+ <%= error_tag(f, :current_password, "col-span-3") %>
- <%= submit(dgettext("actions", "Change password"), class: "btn btn-primary") %>
+ <%= submit(dgettext("actions", "Change password"), class: "mx-auto my-4 btn btn-primary col-span-3") %>
<% end %>
+
+
<%= link(dgettext("actions", "Delete User"),
to: Routes.user_settings_path(@conn, :delete, @current_user),
method: :delete,
diff --git a/lib/cannery_web/views/view_helpers.ex b/lib/cannery_web/views/view_helpers.ex
index 1b0d852e..7cc81326 100644
--- a/lib/cannery_web/views/view_helpers.ex
+++ b/lib/cannery_web/views/view_helpers.ex
@@ -13,6 +13,7 @@ defmodule CanneryWeb.ViewHelpers do
"""
@spec display_datetime(NaiveDateTime.t() | nil) :: Phoenix.LiveView.Rendered.t()
def display_datetime(nil), do: ""
+
def display_datetime(datetime) do
assigns = %{
datetime: datetime |> DateTime.from_naive!("Etc/UTC") |> DateTime.to_iso8601(:extended)
@@ -39,8 +40,9 @@ defmodule CanneryWeb.ViewHelpers do
"""
@spec display_date(Date.t() | nil) :: Phoenix.LiveView.Rendered.t()
def display_date(nil), do: ""
+
def display_date(date) do
- assigns = %{date: date |> Date.to_iso8601(:extended)}
+ assigns = %{date: date |> Date.to_iso8601(:extended)}
~H"""