forked from hiway/freedive
Update design for account settings page
This commit is contained in:
parent
b05fd3f763
commit
d08abf4661
1 changed files with 72 additions and 64 deletions
|
@ -5,71 +5,79 @@ defmodule FreediveWeb.UserSettingsLive do
|
||||||
|
|
||||||
def render(assigns) do
|
def render(assigns) do
|
||||||
~H"""
|
~H"""
|
||||||
<.header class="text-center">
|
<.section>
|
||||||
Account Settings
|
<.title>
|
||||||
<:subtitle>Manage your account email address and password settings</:subtitle>
|
Account Settings
|
||||||
</.header>
|
</.title>
|
||||||
|
<.subtitle>
|
||||||
|
Manage your account email address and password settings
|
||||||
|
</.subtitle>
|
||||||
|
</.section>
|
||||||
|
<.section>
|
||||||
|
<.title is-4>
|
||||||
|
Email
|
||||||
|
</.title>
|
||||||
|
|
||||||
<div class="space-y-12 divide-y">
|
<.simple_form
|
||||||
<div>
|
for={@email_form}
|
||||||
<.simple_form
|
id="email_form"
|
||||||
for={@email_form}
|
phx-submit="update_email"
|
||||||
id="email_form"
|
phx-change="validate_email"
|
||||||
phx-submit="update_email"
|
>
|
||||||
phx-change="validate_email"
|
<.input field={@email_form[:email]} type="email" label="Email" required />
|
||||||
>
|
<.input
|
||||||
<.input field={@email_form[:email]} type="email" label="Email" required />
|
field={@email_form[:current_password]}
|
||||||
<.input
|
name="current_password"
|
||||||
field={@email_form[:current_password]}
|
id="current_password_for_email"
|
||||||
name="current_password"
|
type="password"
|
||||||
id="current_password_for_email"
|
label="Current password"
|
||||||
type="password"
|
value={@email_form_current_password}
|
||||||
label="Current password"
|
required
|
||||||
value={@email_form_current_password}
|
/>
|
||||||
required
|
<:actions>
|
||||||
/>
|
<.button phx-disable-with="Changing...">Change Email</.button>
|
||||||
<:actions>
|
</:actions>
|
||||||
<.button phx-disable-with="Changing...">Change Email</.button>
|
</.simple_form>
|
||||||
</:actions>
|
</.section>
|
||||||
</.simple_form>
|
<.section>
|
||||||
</div>
|
<.title is-4>
|
||||||
<div>
|
Password
|
||||||
<.simple_form
|
</.title>
|
||||||
for={@password_form}
|
<.simple_form
|
||||||
id="password_form"
|
for={@password_form}
|
||||||
action={~p"/users/log_in?_action=password_updated"}
|
id="password_form"
|
||||||
method="post"
|
action={~p"/users/log_in?_action=password_updated"}
|
||||||
phx-change="validate_password"
|
method="post"
|
||||||
phx-submit="update_password"
|
phx-change="validate_password"
|
||||||
phx-trigger-action={@trigger_submit}
|
phx-submit="update_password"
|
||||||
>
|
phx-trigger-action={@trigger_submit}
|
||||||
<input
|
>
|
||||||
name={@password_form[:email].name}
|
<input
|
||||||
type="hidden"
|
name={@password_form[:email].name}
|
||||||
id="hidden_user_email"
|
type="hidden"
|
||||||
value={@current_email}
|
id="hidden_user_email"
|
||||||
/>
|
value={@current_email}
|
||||||
<.input field={@password_form[:password]} type="password" label="New password" required />
|
/>
|
||||||
<.input
|
<.input field={@password_form[:password]} type="password" label="New password" required />
|
||||||
field={@password_form[:password_confirmation]}
|
<.input
|
||||||
type="password"
|
field={@password_form[:password_confirmation]}
|
||||||
label="Confirm new password"
|
type="password"
|
||||||
/>
|
label="Confirm new password"
|
||||||
<.input
|
/>
|
||||||
field={@password_form[:current_password]}
|
<.input
|
||||||
name="current_password"
|
field={@password_form[:current_password]}
|
||||||
type="password"
|
name="current_password"
|
||||||
label="Current password"
|
type="password"
|
||||||
id="current_password_for_password"
|
label="Current password"
|
||||||
value={@current_password}
|
id="current_password_for_password"
|
||||||
required
|
value={@current_password}
|
||||||
/>
|
required
|
||||||
<:actions>
|
/>
|
||||||
<.button phx-disable-with="Changing...">Change Password</.button>
|
<:actions>
|
||||||
</:actions>
|
<.button phx-disable-with="Changing...">Change Password</.button>
|
||||||
</.simple_form>
|
</:actions>
|
||||||
</div>
|
</.simple_form>
|
||||||
</div>
|
</.section>
|
||||||
"""
|
"""
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue