NEW: user accounts (#3)
This commit is contained in:
parent
d02c491028
commit
9990771c18
31 changed files with 1640 additions and 207 deletions
49
lib/planner_web/templates/user_settings/edit.html.eex
Normal file
49
lib/planner_web/templates/user_settings/edit.html.eex
Normal file
|
@ -0,0 +1,49 @@
|
|||
<h1>Settings</h1>
|
||||
|
||||
<h3>Change e-mail</h3>
|
||||
|
||||
<%= form_for @email_changeset, Routes.user_settings_path(@conn, :update_email), 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 %>
|
||||
|
||||
<%= label f, :email %>
|
||||
<%= text_input f, :email, required: true %>
|
||||
<%= error_tag f, :email %>
|
||||
|
||||
<%= label f, :current_password, for: "current_password_for_email" %>
|
||||
<%= password_input f, :current_password, required: true, name: "current_password", id: "current_password_for_email" %>
|
||||
<%= error_tag f, :current_password %>
|
||||
|
||||
<div>
|
||||
<%= submit "Change e-mail" %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<h3>Change password</h3>
|
||||
|
||||
<%= form_for @password_changeset, Routes.user_settings_path(@conn, :update_password), 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 %>
|
||||
|
||||
<%= label f, :password, "New password" %>
|
||||
<%= password_input f, :password, required: true %>
|
||||
<%= error_tag f, :password %>
|
||||
|
||||
<%= label f, :password_confirmation, "Confirm new password" %>
|
||||
<%= password_input f, :password_confirmation, required: true %>
|
||||
<%= error_tag f, :password_confirmation %>
|
||||
|
||||
<%= label f, :current_password, for: "current_password_for_password" %>
|
||||
<%= password_input f, :current_password, required: true, name: "current_password", id: "current_password_for_password" %>
|
||||
<%= error_tag f, :current_password %>
|
||||
|
||||
<div>
|
||||
<%= submit "Change password" %>
|
||||
</div>
|
||||
<% end %>
|
Loading…
Add table
Add a link
Reference in a new issue