61 lines
1.8 KiB
Elixir
61 lines
1.8 KiB
Elixir
<h1>Account settings</h1>
|
|
|
|
<p>
|
|
You are currently logged in as <%= @current_user.username %> (<i><%=
|
|
@current_user.dn %></i>), using <%= @current_user.email %> as primary contact
|
|
method.
|
|
</p>
|
|
|
|
<h3>Change email</h3>
|
|
|
|
<%= form_for @email_changeset, Routes.user_settings_path(@conn, :update), fn f -> %>
|
|
<%= 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" %>
|
|
|
|
<%= email_input f, :email, required: true, placeholder: "Email" %>
|
|
<%= error_tag f, :email %>
|
|
|
|
<br />
|
|
|
|
<%= password_input f, :current_password, required: true, name: "current_password", id: "current_password_for_email", placeholder: "Current password" %>
|
|
<%= error_tag f, :current_password %>
|
|
|
|
<div>
|
|
<%= submit "Change email" %>
|
|
</div>
|
|
<% end %>
|
|
|
|
<h3>Change password</h3>
|
|
|
|
<%= form_for @password_changeset, Routes.user_settings_path(@conn, :update), fn f -> %>
|
|
<%= 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" %>
|
|
|
|
<%= password_input f, :password, required: true, placeholder: "New password" %>
|
|
<%= error_tag f, :password %>
|
|
|
|
<br />
|
|
|
|
<%= password_input f, :password_confirmation, required: true, placeholder: "New password confirmation" %>
|
|
<%= error_tag f, :password_confirmation %>
|
|
|
|
<br />
|
|
|
|
<%= password_input f, :current_password, required: true, name: "current_password", id: "current_password_for_password", placeholder: "Current password" %>
|
|
<%= error_tag f, :current_password %>
|
|
|
|
<div>
|
|
<%= submit "Change password" %>
|
|
</div>
|
|
<% end %>
|