From ad1e44fd429d8080c0117cf78b6d2cf263031673 Mon Sep 17 00:00:00 2001 From: shibao Date: Tue, 14 Feb 2023 00:02:42 -0500 Subject: [PATCH] improve user settings --- .../templates/user_settings/edit.html.heex | 33 +++++++++---------- priv/gettext/actions.pot | 12 +++---- priv/gettext/default.pot | 10 +++--- priv/gettext/en/LC_MESSAGES/actions.po | 12 +++---- priv/gettext/en/LC_MESSAGES/default.po | 10 +++--- priv/gettext/en/LC_MESSAGES/errors.po | 6 ++-- priv/gettext/en/LC_MESSAGES/prompts.po | 4 +-- priv/gettext/errors.pot | 6 ++-- priv/gettext/prompts.pot | 4 +-- 9 files changed, 48 insertions(+), 49 deletions(-) diff --git a/lib/lokal_web/templates/user_settings/edit.html.heex b/lib/lokal_web/templates/user_settings/edit.html.heex index 7a23fcbd..87df5d31 100644 --- a/lib/lokal_web/templates/user_settings/edit.html.heex +++ b/lib/lokal_web/templates/user_settings/edit.html.heex @@ -1,5 +1,5 @@ -
-

+
+

<%= gettext("Settings") %>

@@ -11,7 +11,7 @@ action={Routes.user_settings_path(@conn, :update)} class="flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center" > -

+

<%= dgettext("actions", "Change email") %>

@@ -19,9 +19,7 @@ :if={@email_changeset.action && not @email_changeset.valid?()} class="alert alert-danger col-span-3" > -

- <%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %> -

+ <%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %>
<%= hidden_input(f, :action, name: "action", value: "update_email") %> @@ -55,7 +53,7 @@ action={Routes.user_settings_path(@conn, :update)} class="flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center" > -

+

<%= dgettext("actions", "Change password") %>

@@ -63,9 +61,7 @@ :if={@password_changeset.action && not @password_changeset.valid?()} class="alert alert-danger col-span-3" > -

- <%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %> -

+ <%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %>
<%= hidden_input(f, :action, name: "action", value: "update_password") %> @@ -109,25 +105,28 @@ :let={f} for={@locale_changeset} action={Routes.user_settings_path(@conn, :update)} - class="flex flex-col space-y-4 justify-center items-center" + class="flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center" > -

+

<%= dgettext("actions", "Change Language") %>

-

+

<%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %> -

+
<%= hidden_input(f, :action, name: "action", value: "update_locale") %> <%= select(f, :locale, [{gettext("English"), "en_US"}, {"Spanish", "es"}], - class: "mx-2 my-1 min-w-md input input-primary" + class: "mx-2 my-1 min-w-md input input-primary col-span-3" ) %> - <%= error_tag(f, :locale) %> + <%= error_tag(f, :locale, "col-span-3") %> <%= submit(dgettext("actions", "Change language"), - class: "whitespace-nowrap mx-auto btn btn-primary", + class: "whitespace-nowrap mx-auto btn btn-primary col-span-3", data: [qa: dgettext("prompts", "Are you sure you want to change your language?")] ) %> diff --git a/priv/gettext/actions.pot b/priv/gettext/actions.pot index f421dd46..24ce20f6 100644 --- a/priv/gettext/actions.pot +++ b/priv/gettext/actions.pot @@ -11,18 +11,18 @@ msgid "" msgstr "" #: lib/lokal_web/templates/user_settings/edit.html.heex:15 -#: lib/lokal_web/templates/user_settings/edit.html.heex:45 +#: lib/lokal_web/templates/user_settings/edit.html.heex:43 #, elixir-autogen, elixir-format msgid "Change email" msgstr "" -#: lib/lokal_web/templates/user_settings/edit.html.heex:59 -#: lib/lokal_web/templates/user_settings/edit.html.heex:101 +#: lib/lokal_web/templates/user_settings/edit.html.heex:57 +#: lib/lokal_web/templates/user_settings/edit.html.heex:97 #, elixir-autogen, elixir-format msgid "Change password" msgstr "" -#: lib/lokal_web/templates/user_settings/edit.html.heex:143 +#: lib/lokal_web/templates/user_settings/edit.html.heex:142 #, elixir-autogen, elixir-format msgid "Delete User" msgstr "" @@ -93,12 +93,12 @@ msgstr "" msgid "Save" msgstr "" -#: lib/lokal_web/templates/user_settings/edit.html.heex:115 +#: lib/lokal_web/templates/user_settings/edit.html.heex:111 #, elixir-autogen, elixir-format msgid "Change Language" msgstr "" -#: lib/lokal_web/templates/user_settings/edit.html.heex:129 +#: lib/lokal_web/templates/user_settings/edit.html.heex:128 #, elixir-autogen, elixir-format msgid "Change language" msgstr "" diff --git a/priv/gettext/default.pot b/priv/gettext/default.pot index 02841241..94a68455 100644 --- a/priv/gettext/default.pot +++ b/priv/gettext/default.pot @@ -10,7 +10,7 @@ msgid "" msgstr "" -#: lib/lokal_web/templates/user_settings/edit.html.heex:80 +#: lib/lokal_web/templates/user_settings/edit.html.heex:76 #, elixir-autogen, elixir-format msgid "Confirm new password" msgstr "" @@ -20,8 +20,8 @@ msgstr "" msgid "Confirm your account" msgstr "" -#: lib/lokal_web/templates/user_settings/edit.html.heex:33 -#: lib/lokal_web/templates/user_settings/edit.html.heex:89 +#: lib/lokal_web/templates/user_settings/edit.html.heex:31 +#: lib/lokal_web/templates/user_settings/edit.html.heex:85 #, elixir-autogen, elixir-format msgid "Current password" msgstr "" @@ -53,7 +53,7 @@ msgstr "" msgid "Log in" msgstr "" -#: lib/lokal_web/templates/user_settings/edit.html.heex:73 +#: lib/lokal_web/templates/user_settings/edit.html.heex:69 #, elixir-autogen, elixir-format msgid "New password" msgstr "" @@ -135,7 +135,7 @@ msgid "Uses left" msgstr "" #: lib/lokal_web/templates/user_registration/new.html.heex:32 -#: lib/lokal_web/templates/user_settings/edit.html.heex:124 +#: lib/lokal_web/templates/user_settings/edit.html.heex:123 #, elixir-autogen, elixir-format msgid "English" msgstr "" diff --git a/priv/gettext/en/LC_MESSAGES/actions.po b/priv/gettext/en/LC_MESSAGES/actions.po index 3f5d0366..4dac6f7b 100644 --- a/priv/gettext/en/LC_MESSAGES/actions.po +++ b/priv/gettext/en/LC_MESSAGES/actions.po @@ -11,18 +11,18 @@ msgstr "" "Language: en\n" #: lib/lokal_web/templates/user_settings/edit.html.heex:15 -#: lib/lokal_web/templates/user_settings/edit.html.heex:45 +#: lib/lokal_web/templates/user_settings/edit.html.heex:43 #, elixir-autogen, elixir-format msgid "Change email" msgstr "" -#: lib/lokal_web/templates/user_settings/edit.html.heex:59 -#: lib/lokal_web/templates/user_settings/edit.html.heex:101 +#: lib/lokal_web/templates/user_settings/edit.html.heex:57 +#: lib/lokal_web/templates/user_settings/edit.html.heex:97 #, elixir-autogen, elixir-format msgid "Change password" msgstr "" -#: lib/lokal_web/templates/user_settings/edit.html.heex:143 +#: lib/lokal_web/templates/user_settings/edit.html.heex:142 #, elixir-autogen, elixir-format msgid "Delete User" msgstr "" @@ -93,12 +93,12 @@ msgstr "" msgid "Save" msgstr "" -#: lib/lokal_web/templates/user_settings/edit.html.heex:115 +#: lib/lokal_web/templates/user_settings/edit.html.heex:111 #, elixir-autogen, elixir-format msgid "Change Language" msgstr "" -#: lib/lokal_web/templates/user_settings/edit.html.heex:129 +#: lib/lokal_web/templates/user_settings/edit.html.heex:128 #, elixir-autogen, elixir-format msgid "Change language" msgstr "" diff --git a/priv/gettext/en/LC_MESSAGES/default.po b/priv/gettext/en/LC_MESSAGES/default.po index 08bdfdaf..c384ce40 100644 --- a/priv/gettext/en/LC_MESSAGES/default.po +++ b/priv/gettext/en/LC_MESSAGES/default.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Language: en\n" -#: lib/lokal_web/templates/user_settings/edit.html.heex:80 +#: lib/lokal_web/templates/user_settings/edit.html.heex:76 #, elixir-autogen, elixir-format msgid "Confirm new password" msgstr "" @@ -20,8 +20,8 @@ msgstr "" msgid "Confirm your account" msgstr "" -#: lib/lokal_web/templates/user_settings/edit.html.heex:33 -#: lib/lokal_web/templates/user_settings/edit.html.heex:89 +#: lib/lokal_web/templates/user_settings/edit.html.heex:31 +#: lib/lokal_web/templates/user_settings/edit.html.heex:85 #, elixir-autogen, elixir-format msgid "Current password" msgstr "" @@ -53,7 +53,7 @@ msgstr "" msgid "Log in" msgstr "" -#: lib/lokal_web/templates/user_settings/edit.html.heex:73 +#: lib/lokal_web/templates/user_settings/edit.html.heex:69 #, elixir-autogen, elixir-format msgid "New password" msgstr "" @@ -135,7 +135,7 @@ msgid "Uses left" msgstr "" #: lib/lokal_web/templates/user_registration/new.html.heex:32 -#: lib/lokal_web/templates/user_settings/edit.html.heex:124 +#: lib/lokal_web/templates/user_settings/edit.html.heex:123 #, elixir-autogen, elixir-format msgid "English" msgstr "" diff --git a/priv/gettext/en/LC_MESSAGES/errors.po b/priv/gettext/en/LC_MESSAGES/errors.po index b35ad8d1..9df7ca50 100644 --- a/priv/gettext/en/LC_MESSAGES/errors.po +++ b/priv/gettext/en/LC_MESSAGES/errors.po @@ -128,9 +128,9 @@ msgstr "" #: lib/lokal_web/templates/user_registration/new.html.heex:13 #: lib/lokal_web/templates/user_reset_password/edit.html.heex:13 -#: lib/lokal_web/templates/user_settings/edit.html.heex:23 -#: lib/lokal_web/templates/user_settings/edit.html.heex:67 -#: lib/lokal_web/templates/user_settings/edit.html.heex:119 +#: lib/lokal_web/templates/user_settings/edit.html.heex:22 +#: lib/lokal_web/templates/user_settings/edit.html.heex:64 +#: lib/lokal_web/templates/user_settings/edit.html.heex:118 #, elixir-autogen, elixir-format msgid "Oops, something went wrong! Please check the errors below." msgstr "" diff --git a/priv/gettext/en/LC_MESSAGES/prompts.po b/priv/gettext/en/LC_MESSAGES/prompts.po index e66c50e2..1ec7d3e5 100644 --- a/priv/gettext/en/LC_MESSAGES/prompts.po +++ b/priv/gettext/en/LC_MESSAGES/prompts.po @@ -20,7 +20,7 @@ msgstr "" msgid "A link to confirm your email change has been sent to the new address." msgstr "" -#: lib/lokal_web/templates/user_settings/edit.html.heex:141 +#: lib/lokal_web/templates/user_settings/edit.html.heex:140 #, elixir-autogen, elixir-format msgid "Are you sure you want to delete your account?" msgstr "" @@ -86,7 +86,7 @@ msgstr "" msgid "Saving..." msgstr "" -#: lib/lokal_web/templates/user_settings/edit.html.heex:131 +#: lib/lokal_web/templates/user_settings/edit.html.heex:130 #, elixir-autogen, elixir-format msgid "Are you sure you want to change your language?" msgstr "" diff --git a/priv/gettext/errors.pot b/priv/gettext/errors.pot index dd871952..4eb23dfc 100644 --- a/priv/gettext/errors.pot +++ b/priv/gettext/errors.pot @@ -125,9 +125,9 @@ msgstr "" #: lib/lokal_web/templates/user_registration/new.html.heex:13 #: lib/lokal_web/templates/user_reset_password/edit.html.heex:13 -#: lib/lokal_web/templates/user_settings/edit.html.heex:23 -#: lib/lokal_web/templates/user_settings/edit.html.heex:67 -#: lib/lokal_web/templates/user_settings/edit.html.heex:119 +#: lib/lokal_web/templates/user_settings/edit.html.heex:22 +#: lib/lokal_web/templates/user_settings/edit.html.heex:64 +#: lib/lokal_web/templates/user_settings/edit.html.heex:118 #, elixir-autogen, elixir-format msgid "Oops, something went wrong! Please check the errors below." msgstr "" diff --git a/priv/gettext/prompts.pot b/priv/gettext/prompts.pot index a1292fc8..85c9e993 100644 --- a/priv/gettext/prompts.pot +++ b/priv/gettext/prompts.pot @@ -20,7 +20,7 @@ msgstr "" msgid "A link to confirm your email change has been sent to the new address." msgstr "" -#: lib/lokal_web/templates/user_settings/edit.html.heex:141 +#: lib/lokal_web/templates/user_settings/edit.html.heex:140 #, elixir-autogen, elixir-format msgid "Are you sure you want to delete your account?" msgstr "" @@ -86,7 +86,7 @@ msgstr "" msgid "Saving..." msgstr "" -#: lib/lokal_web/templates/user_settings/edit.html.heex:131 +#: lib/lokal_web/templates/user_settings/edit.html.heex:130 #, elixir-autogen, elixir-format msgid "Are you sure you want to change your language?" msgstr ""