My space on the web https://inhji.de
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

99 lines
2.7 KiB

<header class="hero">
<h1>Edit User</h1>
</header>
<h3>Change profile</h3>
<%= form_for @profile_changeset, Routes.user_settings_path(@conn, :update), fn f -> %>
<%= if @profile_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_profile" %>
<fieldset>
<%= label f, :name %>
<%= text_input f, :name, required: true %>
<%= error_tag f, :name %>
</fieldset>
<fieldset>
<%= label f, :real_name %>
<%= text_input f, :real_name, required: true %>
<%= error_tag f, :real_name %>
</fieldset>
<fieldset>
<%= label f, :notes %>
<%= textarea f, :notes, required: true %>
<%= error_tag f, :notes %>
</fieldset>
<div>
<%= submit "Change Profile" %>
</div>
<% end %>
<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" %>
<fieldset>
<%= label f, :email %>
<%= email_input f, :email, required: true %>
<%= error_tag f, :email %>
</fieldset>
<fieldset>
<%= 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 %>
</fieldset>
<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" %>
<fieldset>
<%= label f, :password, "New password" %>
<%= password_input f, :password, required: true %>
<%= error_tag f, :password %>
</fieldset>
<fieldset>
<%= label f, :password_confirmation, "Confirm new password" %>
<%= password_input f, :password_confirmation, required: true %>
<%= error_tag f, :password_confirmation %>
</fieldset>
<fieldset>
<%= 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 %>
</fieldset>
<fieldset>
<%= submit "Change password" %>
</fieldset>
<% end %>