add mail+pass change option
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
end
|
||||
%>
|
||||
|
||||
<%= link_to (@user.is?(current_user) ? "Your profile" : @user.name), current_user %> → Edit
|
||||
<%= link_to @user.name, current_user %> → Edit
|
||||
<h1>Edit profile</h1>
|
||||
|
||||
<%= form_for @user do |f| %>
|
||||
@@ -60,7 +60,9 @@
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<p><%= f.submit "Save profile", class: "btn blue", disabled: (!@user.confirmed? && @user.is?(current_user)) %></p>
|
||||
<p><%= f.submit "Save profile", class: "btn blue left", disabled: (!@user.confirmed? && @user.is?(current_user)) %></p>
|
||||
<p><%= link_to "Edit login details", edit_login_user_path(@user), class: "btn blue right" %></p>
|
||||
<div class="clear"></div>
|
||||
|
||||
<% if !@user.confirmed? %>
|
||||
<% if @user.is?(current_user) %>
|
||||
|
||||
36
app/views/users/edit_login.html.erb
Normal file
36
app/views/users/edit_login.html.erb
Normal file
@@ -0,0 +1,36 @@
|
||||
<%= link_to @user.name, @user %> → Edit Login credentials
|
||||
<h1>Edit Login credentials</h1>
|
||||
|
||||
|
||||
<%= form_for @user, url: update_login_user_path(@user), method: :put do |f| %>
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>New email</td>
|
||||
<td>
|
||||
<%= f.text_field :email %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>New password</td>
|
||||
<td>
|
||||
<%= f.password_field :password %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Repeat new password</td>
|
||||
<td>
|
||||
<%= f.password_field :password_confirmation %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Current password</td>
|
||||
<td>
|
||||
<%= password_field_tag :current_password, nil, disabled: !@user.is?(current_user) %>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p><%= f.submit "Save changes", class: "btn blue left" %></p>
|
||||
<div class="clear"></div>
|
||||
<% end %>
|
||||
Reference in New Issue
Block a user