Hash :
23de5e02
Author :
Thomas de Grivel
Date :
2021-12-09T12:04:20
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
<div class="container-fluid">
<h1>
<%= gettext "Edit user" %>
<%= @current_user.slug.slug %>
</h1>
<h2><%= gettext "Change email" %></h2>
<.form let={f} for={@email_changeset} action={Routes.user_settings_path(@conn, :update)} id="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" %>
<div class="mb-3">
<%= label f, :email, class: "form-label" %>
<%= email_input f, :email, class: "form-control", required: true %>
<%= error_tag f, :email %>
</div>
<div class="mb-3">
<%= label f, :current_password, for: "current_password_for_email", class: "form-label" %>
<%= password_input f, :current_password, required: true, name: "current_password", id: "current_password_for_email", class: "form-control" %>
<%= error_tag f, :current_password %>
</div>
<div class="mb-3">
<%= submit gettext("Submit"), class: "btn btn-primary" %>
</div>
</.form>
<hr/>
<h2><%= gettext "Change password" %></h2>
<.form let={f} for={@password_changeset} action={Routes.user_settings_path(@conn, :update)} id="update_password">
<%= if @password_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_password" %>
<div class="mb-3">
<%= label f, :password, gettext("New password"), class: "form-label" %>
<%= password_input f, :password, class: "form-control", required: true %>
<%= error_tag f, :password %>
</div>
<div class="mb-3">
<%= label f, :password_confirmation, gettext("Confirm new password"), class: "form-label" %>
<%= password_input f, :password_confirmation, class: "form-control", required: true %>
<%= error_tag f, :password_confirmation %>
</div>
<div class="mb-3">
<%= label f, :current_password, for: "current_password_for_password", class: "form-label" %>
<%= password_input f, :current_password, required: true, name: "current_password", id: "current_password_for_password", class: "form-control" %>
<%= error_tag f, :current_password %>
</div>
<div class="mb-3">
<%= submit gettext("Submit"), class: "btn btn-primary" %>
</div>
</.form>
</div>