Skip to content

Commit

Permalink
Merge pull request #2544 from pat-son/noUserSelfDelete
Browse files Browse the repository at this point in the history
Removed the ability to delete your own account
  • Loading branch information
tylerpuleo authored Nov 18, 2016
2 parents 04ee19e + b81e4d5 commit 15db8fb
Showing 1 changed file with 30 additions and 42 deletions.
72 changes: 30 additions & 42 deletions app/views/devise/registrations/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,58 +1,46 @@
<%= devise_error_messages! %><br>
<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
<div class="row">
<div class="col-lg-6 col-lg-offset-3">
<div class="panel panel-default">
<div class="panel-heading">
<h3>Account Update</h3>
</div>
<div class="row">
<div class="col-lg-6 col-lg-offset-3">
<div class="panel panel-default">
<div class="panel-heading">
<h3>Account Update</h3>
</div>

<div class="panel-body">


<div class="form-group">
<%= f.label :email %><br />
<%= f.email_field :email, autofocus: true, class: "form-control" %>
</div>
<div class="panel-body">

<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
<div>Currently waiting confirmation for: <%= resource.unconfirmed_email %></div>
<% end %>

<div class="form-group">
<%= f.label :current_password %> <i>(we need your current password to confirm your changes)</i><br />
<%= f.password_field :current_password, autocomplete: "off", class: "form-control" %>
</div>
<hr>
<div class="form-group">
<%= f.label :password %> <i>(8 character minimum)</i><br />
<%= f.password_field :password, autocomplete: "off", class: "form-control", placeholder: "Leave blank if you don't want to change it" %>
</div>
<div class="form-group">
<%= f.label :email %><br />
<%= f.email_field :email, autofocus: true, class: "form-control" %>
</div>

<div class="form-group">
<%= f.label :password_confirmation %><br />
<%= f.password_field :password_confirmation, autocomplete: "off", class: "form-control" %>
</div>
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
<div>Currently waiting confirmation for: <%= resource.unconfirmed_email %></div>
<% end %>

<div class="form-group">
<%= f.label :current_password %> <i>(we need your current password to confirm your changes)</i><br />
<%= f.password_field :current_password, autocomplete: "off", class: "form-control" %>
</div>
<div class="panel-footer">
<hr>
<div class="form-group">
<%= f.submit "Update", class: "mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--blue" %>
<%= f.label :password %> <i>(8 character minimum)</i><br />
<%= f.password_field :password, autocomplete: "off", class: "form-control", placeholder: "Leave blank if you don't want to change it" %>
</div>
</div>
</div>
</div>
<% end %>
<div class="row">
<div class="col-lg-6 col-lg-offset-3">
<div class="panel panel-default">
<div class="panel-heading">
<h3>Cancel my account</h3>

<div class="form-group">
<%= f.label :password_confirmation %><br />
<%= f.password_field :password_confirmation, autocomplete: "off", class: "form-control" %>
</div>
<div class="panel-body">
<p>Unhappy? <%= button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete, class: "mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--red" %></p>

</div>
<div class="panel-footer">
<div class="form-group">
<%= f.submit "Update", class: "mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--blue" %>
</div>
</div>
</div>
</div>
</div>
<% end %>

0 comments on commit 15db8fb

Please sign in to comment.