Compare commits
2 Commits
23e738ddc9
...
8577c9dddb
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8577c9dddb | ||
|
|
f2ff002b98 |
@ -6,19 +6,23 @@
|
|||||||
<p><%= @error_message %></p>
|
<p><%= @error_message %></p>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<ul class="w-1/2 pl-0 flex flex-col gap-6">
|
||||||
<%= label f, :email %>
|
<li class="flex flex-row gap-4">
|
||||||
<%= email_input f, :email, required: true %>
|
<%= label f, :email, class: "w-1/3" %>
|
||||||
|
<%= email_input f, :email, required: true %>
|
||||||
<%= label f, :password %>
|
</li>
|
||||||
<%= password_input f, :password, required: true %>
|
<li class="flex flex-row gap-4">
|
||||||
|
<%= label f, :password, class: "w-1/3" %>
|
||||||
<%= label f, :remember_me, "Keep me logged in for 60 days" %>
|
<%= password_input f, :password, required: true %>
|
||||||
<%= checkbox f, :remember_me %>
|
</li>
|
||||||
|
<li class="flex flex-row gap-4">
|
||||||
<div>
|
<%= label f, :remember_me, "Keep me logged in for 60 days", class: "w-fit" %>
|
||||||
<%= submit "Log in" %>
|
<%= checkbox f, :remember_me %>
|
||||||
</div>
|
</li>
|
||||||
|
<li class="flex">
|
||||||
|
<%= submit "Log in", class: "btn btn-primary" %>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
</.form>
|
</.form>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|||||||
@ -1,53 +1,78 @@
|
|||||||
<h1>Settings</h1>
|
<h1>Settings</h1>
|
||||||
|
|
||||||
<h3>Change email</h3>
|
<div class="flex gap-16 flex-col md:flex-row justify-evenly">
|
||||||
|
<.form
|
||||||
|
let={f}
|
||||||
|
for={@email_changeset}
|
||||||
|
action={Routes.user_settings_path(@conn, :update)}
|
||||||
|
id="update_email"
|
||||||
|
class="w-max"
|
||||||
|
>
|
||||||
|
<%= if @email_changeset.action do %>
|
||||||
|
<div class="alert alert-danger">
|
||||||
|
<p>Oops, something went wrong! Please check the errors below.</p>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<.form let={f} for={@email_changeset} action={Routes.user_settings_path(@conn, :update)} id="update_email">
|
<%= hidden_input f, :action, name: "action", value: "update_email" %>
|
||||||
<%= if @email_changeset.action do %>
|
|
||||||
<div class="alert alert-danger">
|
|
||||||
<p>Oops, something went wrong! Please check the errors below.</p>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<%= hidden_input f, :action, name: "action", value: "update_email" %>
|
|
||||||
|
|
||||||
<%= label f, :email %>
|
<h3>Change email</h3>
|
||||||
<%= email_input f, :email, required: true %>
|
<ul class="w-full pl-0 flex flex-col gap-6">
|
||||||
<%= error_tag f, :email %>
|
|
||||||
|
|
||||||
<%= label f, :current_password, for: "current_password_for_email" %>
|
<li class="flex flex-row gap-4">
|
||||||
<%= password_input f, :current_password, required: true, name: "current_password", id: "current_password_for_email" %>
|
<%= label f, :email, class: "w-1/3" %>
|
||||||
<%= error_tag f, :current_password %>
|
<%= email_input f, :email, required: true %>
|
||||||
|
<%= error_tag f, :email %>
|
||||||
|
</li>
|
||||||
|
<li class="flex flex-row gap-4">
|
||||||
|
<%= label f, :current_password, for: "current_password_for_email", class: "w-1/3" %>
|
||||||
|
<%= password_input f, :password, required: true %>
|
||||||
|
<%= error_tag f, :current_password %>
|
||||||
|
</li>
|
||||||
|
<li class="flex place-self-stretch">
|
||||||
|
<%= submit "Change email", class: "btn btn-primary" %>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</.form>
|
||||||
|
|
||||||
<div>
|
<.form
|
||||||
<%= submit "Change email" %>
|
let={f}
|
||||||
</div>
|
for={@password_changeset}
|
||||||
</.form>
|
action={Routes.user_settings_path(@conn, :update)}
|
||||||
|
id="update_password"
|
||||||
|
class="w-max"
|
||||||
|
>
|
||||||
|
|
||||||
<h3>Change password</h3>
|
<h3>Change password</h3>
|
||||||
|
|
||||||
<.form let={f} for={@password_changeset} action={Routes.user_settings_path(@conn, :update)} id="update_password">
|
<ul class="w-full pl-0 flex flex-col gap-6 md:h-full">
|
||||||
<%= if @password_changeset.action do %>
|
<%= if @password_changeset.action do %>
|
||||||
<div class="alert alert-danger">
|
<div class="alert alert-danger">
|
||||||
<p>Oops, something went wrong! Please check the errors below.</p>
|
<p>Oops, something went wrong! Please check the errors below.</p>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%= hidden_input f, :action, name: "action", value: "update_password" %>
|
<%= hidden_input f, :action, name: "action", value: "update_password" %>
|
||||||
|
|
||||||
<%= label f, :password, "New password" %>
|
<li class="flex flex-row gap-4">
|
||||||
<%= password_input f, :password, required: true %>
|
<%= label f, :current_password, for: "current_password_for_password", class: "w-1/3" %>
|
||||||
<%= error_tag f, :password %>
|
<%= password_input f, :current_password, required: true, name: "current_password", id: "current_password_for_password" %>
|
||||||
|
<%= error_tag f, :current_password %>
|
||||||
<%= label f, :password_confirmation, "Confirm new password" %>
|
</li>
|
||||||
<%= password_input f, :password_confirmation, required: true %>
|
<li class="flex flex-row gap-4">
|
||||||
<%= error_tag f, :password_confirmation %>
|
<%= label f, :password, "New password", class: "w-1/3" %>
|
||||||
|
<%= password_input f, :password, required: true, class: "shrink-0" %>
|
||||||
<%= label f, :current_password, for: "current_password_for_password" %>
|
<%= error_tag f, :password %>
|
||||||
<%= password_input f, :current_password, required: true, name: "current_password", id: "current_password_for_password" %>
|
</li>
|
||||||
<%= error_tag f, :current_password %>
|
<li class="flex flex-row gap-4">
|
||||||
|
<%= label f, :password_confirmation, "Confirm new password", class: "w-1/3" %>
|
||||||
<div>
|
<%= password_input f, :password_confirmation, required: true %>
|
||||||
<%= submit "Change password" %>
|
<%= error_tag f, :password_confirmation %>
|
||||||
</div>
|
</li>
|
||||||
</.form>
|
<li class="flex">
|
||||||
|
<%= submit "Change password", class: "btn btn-primary" %>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</.form>
|
||||||
|
</div>
|
||||||
Loading…
Reference in New Issue
Block a user