improve user settings

This commit is contained in:
shibao 2023-02-14 00:02:42 -05:00 committed by oliviasculley
parent 56dae6cdfe
commit ad1e44fd42
9 changed files with 48 additions and 49 deletions

View File

@ -1,5 +1,5 @@
<div class="mx-auto pb-8 max-w-2xl flex flex-col justify-center items-center text-center space-y-4"> <div class="mx-auto pb-8 max-w-2xl flex flex-col justify-center items-center text-right space-y-4">
<h1 class="pb-4 title text-primary-600 text-xl"> <h1 class="pb-4 title text-primary-600 text-2xl text-center">
<%= gettext("Settings") %> <%= gettext("Settings") %>
</h1> </h1>
@ -11,7 +11,7 @@
action={Routes.user_settings_path(@conn, :update)} 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" class="flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
> >
<h3 class="title text-primary-600 text-lg col-span-3"> <h3 class="title text-primary-600 text-lg text-center col-span-3">
<%= dgettext("actions", "Change email") %> <%= dgettext("actions", "Change email") %>
</h3> </h3>
@ -19,9 +19,7 @@
:if={@email_changeset.action && not @email_changeset.valid?()} :if={@email_changeset.action && not @email_changeset.valid?()}
class="alert alert-danger col-span-3" class="alert alert-danger col-span-3"
> >
<p> <%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %>
<%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %>
</p>
</div> </div>
<%= hidden_input(f, :action, name: "action", value: "update_email") %> <%= hidden_input(f, :action, name: "action", value: "update_email") %>
@ -55,7 +53,7 @@
action={Routes.user_settings_path(@conn, :update)} 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" class="flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
> >
<h3 class="title text-primary-600 text-lg col-span-3"> <h3 class="title text-primary-600 text-lg text-center col-span-3">
<%= dgettext("actions", "Change password") %> <%= dgettext("actions", "Change password") %>
</h3> </h3>
@ -63,9 +61,7 @@
:if={@password_changeset.action && not @password_changeset.valid?()} :if={@password_changeset.action && not @password_changeset.valid?()}
class="alert alert-danger col-span-3" class="alert alert-danger col-span-3"
> >
<p> <%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %>
<%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %>
</p>
</div> </div>
<%= hidden_input(f, :action, name: "action", value: "update_password") %> <%= hidden_input(f, :action, name: "action", value: "update_password") %>
@ -109,25 +105,28 @@
:let={f} :let={f}
for={@locale_changeset} for={@locale_changeset}
action={Routes.user_settings_path(@conn, :update)} 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"
> >
<h3 class="title text-primary-600 text-lg"> <h3 class="title text-primary-600 text-lg text-center col-span-3">
<%= dgettext("actions", "Change Language") %> <%= dgettext("actions", "Change Language") %>
</h3> </h3>
<p :if={@locale_changeset.action && not @locale_changeset.valid?} class="alert alert-danger"> <div
:if={@locale_changeset.action && not @locale_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.") %>
</p> </div>
<%= hidden_input(f, :action, name: "action", value: "update_locale") %> <%= hidden_input(f, :action, name: "action", value: "update_locale") %>
<%= select(f, :locale, [{gettext("English"), "en_US"}, {"Spanish", "es"}], <%= 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"), <%= 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?")] data: [qa: dgettext("prompts", "Are you sure you want to change your language?")]
) %> ) %>
</.form> </.form>

View File

@ -11,18 +11,18 @@ msgid ""
msgstr "" msgstr ""
#: lib/lokal_web/templates/user_settings/edit.html.heex:15 #: 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 #, elixir-autogen, elixir-format
msgid "Change email" msgid "Change email"
msgstr "" msgstr ""
#: lib/lokal_web/templates/user_settings/edit.html.heex:59 #: lib/lokal_web/templates/user_settings/edit.html.heex:57
#: lib/lokal_web/templates/user_settings/edit.html.heex:101 #: lib/lokal_web/templates/user_settings/edit.html.heex:97
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Change password" msgid "Change password"
msgstr "" 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 #, elixir-autogen, elixir-format
msgid "Delete User" msgid "Delete User"
msgstr "" msgstr ""
@ -93,12 +93,12 @@ msgstr ""
msgid "Save" msgid "Save"
msgstr "" 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 #, elixir-autogen, elixir-format
msgid "Change Language" msgid "Change Language"
msgstr "" 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 #, elixir-autogen, elixir-format
msgid "Change language" msgid "Change language"
msgstr "" msgstr ""

View File

@ -10,7 +10,7 @@
msgid "" msgid ""
msgstr "" 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 #, elixir-autogen, elixir-format
msgid "Confirm new password" msgid "Confirm new password"
msgstr "" msgstr ""
@ -20,8 +20,8 @@ msgstr ""
msgid "Confirm your account" msgid "Confirm your account"
msgstr "" msgstr ""
#: lib/lokal_web/templates/user_settings/edit.html.heex:33 #: lib/lokal_web/templates/user_settings/edit.html.heex:31
#: lib/lokal_web/templates/user_settings/edit.html.heex:89 #: lib/lokal_web/templates/user_settings/edit.html.heex:85
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Current password" msgid "Current password"
msgstr "" msgstr ""
@ -53,7 +53,7 @@ msgstr ""
msgid "Log in" msgid "Log in"
msgstr "" 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 #, elixir-autogen, elixir-format
msgid "New password" msgid "New password"
msgstr "" msgstr ""
@ -135,7 +135,7 @@ msgid "Uses left"
msgstr "" msgstr ""
#: lib/lokal_web/templates/user_registration/new.html.heex:32 #: 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 #, elixir-autogen, elixir-format
msgid "English" msgid "English"
msgstr "" msgstr ""

View File

@ -11,18 +11,18 @@ msgstr ""
"Language: en\n" "Language: en\n"
#: lib/lokal_web/templates/user_settings/edit.html.heex:15 #: 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 #, elixir-autogen, elixir-format
msgid "Change email" msgid "Change email"
msgstr "" msgstr ""
#: lib/lokal_web/templates/user_settings/edit.html.heex:59 #: lib/lokal_web/templates/user_settings/edit.html.heex:57
#: lib/lokal_web/templates/user_settings/edit.html.heex:101 #: lib/lokal_web/templates/user_settings/edit.html.heex:97
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Change password" msgid "Change password"
msgstr "" 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 #, elixir-autogen, elixir-format
msgid "Delete User" msgid "Delete User"
msgstr "" msgstr ""
@ -93,12 +93,12 @@ msgstr ""
msgid "Save" msgid "Save"
msgstr "" 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 #, elixir-autogen, elixir-format
msgid "Change Language" msgid "Change Language"
msgstr "" 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 #, elixir-autogen, elixir-format
msgid "Change language" msgid "Change language"
msgstr "" msgstr ""

View File

@ -10,7 +10,7 @@ msgid ""
msgstr "" msgstr ""
"Language: en\n" "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 #, elixir-autogen, elixir-format
msgid "Confirm new password" msgid "Confirm new password"
msgstr "" msgstr ""
@ -20,8 +20,8 @@ msgstr ""
msgid "Confirm your account" msgid "Confirm your account"
msgstr "" msgstr ""
#: lib/lokal_web/templates/user_settings/edit.html.heex:33 #: lib/lokal_web/templates/user_settings/edit.html.heex:31
#: lib/lokal_web/templates/user_settings/edit.html.heex:89 #: lib/lokal_web/templates/user_settings/edit.html.heex:85
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Current password" msgid "Current password"
msgstr "" msgstr ""
@ -53,7 +53,7 @@ msgstr ""
msgid "Log in" msgid "Log in"
msgstr "" 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 #, elixir-autogen, elixir-format
msgid "New password" msgid "New password"
msgstr "" msgstr ""
@ -135,7 +135,7 @@ msgid "Uses left"
msgstr "" msgstr ""
#: lib/lokal_web/templates/user_registration/new.html.heex:32 #: 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 #, elixir-autogen, elixir-format
msgid "English" msgid "English"
msgstr "" msgstr ""

View File

@ -128,9 +128,9 @@ msgstr ""
#: lib/lokal_web/templates/user_registration/new.html.heex:13 #: 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_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:22
#: lib/lokal_web/templates/user_settings/edit.html.heex:67 #: lib/lokal_web/templates/user_settings/edit.html.heex:64
#: lib/lokal_web/templates/user_settings/edit.html.heex:119 #: lib/lokal_web/templates/user_settings/edit.html.heex:118
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Oops, something went wrong! Please check the errors below." msgid "Oops, something went wrong! Please check the errors below."
msgstr "" msgstr ""

View File

@ -20,7 +20,7 @@ msgstr ""
msgid "A link to confirm your email change has been sent to the new address." msgid "A link to confirm your email change has been sent to the new address."
msgstr "" 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 #, elixir-autogen, elixir-format
msgid "Are you sure you want to delete your account?" msgid "Are you sure you want to delete your account?"
msgstr "" msgstr ""
@ -86,7 +86,7 @@ msgstr ""
msgid "Saving..." msgid "Saving..."
msgstr "" 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 #, elixir-autogen, elixir-format
msgid "Are you sure you want to change your language?" msgid "Are you sure you want to change your language?"
msgstr "" msgstr ""

View File

@ -125,9 +125,9 @@ msgstr ""
#: lib/lokal_web/templates/user_registration/new.html.heex:13 #: 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_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:22
#: lib/lokal_web/templates/user_settings/edit.html.heex:67 #: lib/lokal_web/templates/user_settings/edit.html.heex:64
#: lib/lokal_web/templates/user_settings/edit.html.heex:119 #: lib/lokal_web/templates/user_settings/edit.html.heex:118
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Oops, something went wrong! Please check the errors below." msgid "Oops, something went wrong! Please check the errors below."
msgstr "" msgstr ""

View File

@ -20,7 +20,7 @@ msgstr ""
msgid "A link to confirm your email change has been sent to the new address." msgid "A link to confirm your email change has been sent to the new address."
msgstr "" 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 #, elixir-autogen, elixir-format
msgid "Are you sure you want to delete your account?" msgid "Are you sure you want to delete your account?"
msgstr "" msgstr ""
@ -86,7 +86,7 @@ msgstr ""
msgid "Saving..." msgid "Saving..."
msgstr "" 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 #, elixir-autogen, elixir-format
msgid "Are you sure you want to change your language?" msgid "Are you sure you want to change your language?"
msgstr "" msgstr ""