-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow users to edit and delete their account (#2762)
* Spice up edit page styling and add delete-account * Add specs * Remove commented out shared examples for deactivate * Increase base font size * Convert password-forgot screens to Bootstrap * Fix indentation to 2 spaces * Convert other forms to Bootstrap * Test that current user is logged out
- Loading branch information
Showing
11 changed files
with
258 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
root = true | ||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
indent_style = space | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,26 @@ | ||
<div class="form-container"> | ||
<h2>Change your password</h2> | ||
<div class="form-container panel panel-default"> | ||
<div class="panel-body"> | ||
<h2>Change your password</h2> | ||
|
||
<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put, class: "form" }) do |f| %> | ||
<%= devise_error_messages! %> | ||
<%= f.hidden_field :reset_password_token %> | ||
<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put}) do |f| %> | ||
<%= devise_error_messages! %> | ||
<%= f.hidden_field :reset_password_token %> | ||
|
||
<fieldset class="fieldset--password"> | ||
<%= f.label :password, "New password" %><br /> | ||
<%= f.password_field :password, autofocus: true, autocomplete: "off" %> | ||
</fieldset> | ||
<div class="form-group"> | ||
<%= f.label :password, "New password" %><br /> | ||
<%= f.password_field :password, autofocus: true, autocomplete: "off", class: 'form-control' %> | ||
</div> | ||
|
||
<fieldset class="fieldset--password"> | ||
<%= f.label :password_confirmation, "Confirm new password" %><br /> | ||
<%= f.password_field :password_confirmation, autocomplete: "off" %> | ||
</fieldset> | ||
<div class="form-group"> | ||
<%= f.label :password_confirmation, "Confirm new password" %><br /> | ||
<%= f.password_field :password_confirmation, autocomplete: "off", class: 'form-control' %> | ||
</div> | ||
|
||
<div class="submit-container"><%= f.submit "Change my password" %></div> | ||
<% end %> | ||
|
||
<%= render "devise/shared/links" %> | ||
</div> | ||
<%= f.submit "Change my password", class: 'btn btn-primary' %> | ||
<% end %> | ||
</div> | ||
|
||
<div class="panel-footer"> | ||
<%= render "devise/shared/links" %> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,20 @@ | ||
<div class="form-container"> | ||
<h2>Forgot your password?</h2> | ||
<div class="form-container panel panel-default"> | ||
<div class="panel-body"> | ||
<h2>Forgot your password?</h2> | ||
|
||
<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post, class: "form form--new-password" }) do |f| %> | ||
<%= devise_error_messages! %> | ||
<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %> | ||
<%= devise_error_messages! %> | ||
|
||
<fieldset class="fieldset--email"> | ||
<%= f.label :email %><br /> | ||
<%= f.email_field :email, autofocus: true, required: true %> | ||
</fieldset> | ||
<div class="form-group"> | ||
<%= f.label :email %><br /> | ||
<%= f.email_field :email, autofocus: true, required: true, class: 'form-control' %> | ||
</div> | ||
|
||
<div class="submit-container"><%= f.submit "Send me reset email" %></div> | ||
<% end %> | ||
<%= f.submit "Send me reset email", class: 'btn btn-primary' %> | ||
<% end %> | ||
</div> | ||
|
||
<%= render "devise/shared/links" %> | ||
<div class="panel-footer"> | ||
<%= render "devise/shared/links" %> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,83 @@ | ||
<h2>Edit <%= resource_name.to_s.humanize %></h2> | ||
<div class="form-container panel panel-default"> | ||
<div class="panel-body"> | ||
<h2>Update your profile</h2> | ||
|
||
<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %> | ||
<%= devise_error_messages! %> | ||
<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %> | ||
<%= devise_error_messages! %> | ||
|
||
<div><%= f.label :login %><br /> | ||
<%= f.text_field :login, autofocus: true %></div> | ||
<div class="form-group"> | ||
<%= f.label :login %><br /> | ||
<%= f.text_field :login, autofocus: true, class: 'form-control' %> | ||
</div> | ||
|
||
<div><%= f.label :display_name %><br /> | ||
<%= f.text_field :display_name %></div> | ||
<div class="form-group"> | ||
<%= f.label :display_name %><br /> | ||
<%= f.text_field :display_name, class: 'form-control' %> | ||
</div> | ||
|
||
<div><%= f.label :email %><br /> | ||
<%= f.email_field :email %></div> | ||
<div class="form-group"> | ||
<%= f.label :email %><br /> | ||
<%= f.email_field :email, class: 'form-control' %> | ||
|
||
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %> | ||
<div>Currently waiting confirmation for: <%= resource.unconfirmed_email %></div> | ||
<% end %> | ||
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %> | ||
<div>Currently waiting confirmation for: <%= resource.unconfirmed_email %></div> | ||
<% end %> | ||
</div> | ||
|
||
<div><%= f.label :password %> <i>(leave blank if you don't want to change it)</i><br /> | ||
<%= f.password_field :password, autocomplete: "off" %></div> | ||
<div class="form-group"> | ||
<div class="fieldset--password"> | ||
<%= f.label :password %> <i>(leave blank if you don't want to change it)</i><br /> | ||
<%= f.password_field :password, autocomplete: "off", class: 'form-control' %> | ||
</div> | ||
|
||
<div><%= f.label :password_confirmation %><br /> | ||
<%= f.password_field :password_confirmation, autocomplete: "off" %></div> | ||
<div class="fieldset--password"> | ||
<%= f.label :password_confirmation %><br /> | ||
<%= f.password_field :password_confirmation, autocomplete: "off", class: 'form-control' %> | ||
</div> | ||
</div> | ||
|
||
<div><%= f.label :current_password %> <i>(we need your current password to confirm your changes)</i><br /> | ||
<%= f.password_field :current_password, autocomplete: "off" %></div> | ||
<div class="form-group"> | ||
<div class="fieldset--password"> | ||
<%= 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> | ||
|
||
<div><%= f.submit "Update" %></div> | ||
<% end %> | ||
<%= f.submit "Update", class: 'btn btn-primary' %> | ||
<% end %> | ||
</div> | ||
</div> | ||
|
||
<h3>Cancel my account</h3> | ||
<hr> | ||
|
||
<p>Unhappy? <%= button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete %></p> | ||
<div class="container"> | ||
<div class="row"> | ||
<div class="col-xs-12"> | ||
<div class="form-container" > | ||
<h6>Cancel my account</h6> | ||
|
||
<%= link_to "Back", :back %> | ||
<p> | ||
If for whatever reason you no longer wish to maintain an account with us, | ||
you can delete it here. Please note that any classifications you've made on | ||
projects, and any comments you've posted on our Talk discussion fora will | ||
remain. | ||
</p> | ||
|
||
<% if flash[:delete_alert] %> | ||
<p class="alert"><%= flash[:delete_alert] %></p> | ||
<% end %> | ||
|
||
<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :delete }) do |f| %> | ||
<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> | ||
|
||
<%= f.submit "Cancel my account", class: 'btn btn-danger' %> | ||
<% end %> | ||
|
||
<%= link_to "Back", :back %> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,59 @@ | ||
<div class="form-container"> | ||
<h2>Sign up</h2> | ||
|
||
<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: {class: "form form--new-user"}) do |f| %> | ||
|
||
<div class="row" > | ||
<fieldset class="fieldset--text"> | ||
<%= f.label :login, "Username (required)" %><small class="errored"><%= resource.errors[:login].join(', ')%></small><br /> | ||
<%= f.text_field :login, autofocus: true, required: true %> | ||
</fieldset> | ||
</div> | ||
|
||
<div class="row" > | ||
<fieldset class="fieldset--text"> | ||
<%= f.label :credited_name, "Real Name (optional)" %><small class="errored"><%= resource.errors[:display_name].join(', ')%></small><br /> | ||
<%= f.text_field :display_name %> | ||
<small>We’ll use this to give you credit in scientific papers, posters, etc</small> | ||
</fieldset> | ||
</div> | ||
|
||
<div class="row" > | ||
<fieldset class="fieldset--email"> | ||
<%= f.label :email, "Email (required)"%><small class="errored"><%= resource.errors[:email].join(', ')%></small><br /> | ||
<%= f.email_field :email, required: true %> | ||
</fieldset> | ||
<div class="form-container panel panel-default"> | ||
<div class="panel-body"> | ||
<h2>Create account</h2> | ||
|
||
<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %> | ||
|
||
<div class="form-group <%= "has-errors" if resource.errors[:login].present? %>"> | ||
<%= f.label :login, "Username (required)" %><small class="errored"><%= resource.errors[:login].join(', ')%></small><br /> | ||
<%= f.text_field :login, autofocus: true, required: true, class: 'form-control' %> | ||
</div> | ||
|
||
<div class="form-group <%= "has-errors" if resource.errors[:display_name].present? %>"> | ||
<%= f.label :credited_name, "Real Name (optional)" %><small class="errored"><%= resource.errors[:display_name].join(', ')%></small><br /> | ||
<%= f.text_field :display_name, class: 'form-control' %> | ||
<small>We’ll use this to give you credit in scientific papers, posters, etc</small> | ||
</div> | ||
|
||
<div class="form-group <%= "has-errors" if resource.errors[:email].present? %>"> | ||
<%= f.label :email, "Email (required)"%><small class="errored"><%= resource.errors[:email].join(', ')%></small><br /> | ||
<%= f.email_field :email, required: true, class: 'form-control' %> | ||
</div> | ||
|
||
<div class="form-group" > | ||
<%= f.label :password, "Password (required)"%><small class="errored"><%= resource.errors[:password].join(', ')%></small><br /> | ||
<%= f.password_field :password, autocomplete: "off", required: true, class: 'form-control' %> | ||
|
||
<%= f.label :password_confirmation, "Password confirmation (required)" %><small class="errored"><%= resource.errors[:password_confirmation].join(', ')%></small><br /> | ||
<%= f.password_field :password_confirmation, autocomplete: "off", required: true, class: 'form-control' %> | ||
</div> | ||
|
||
<div class="checkbox" > | ||
<label for="privacy"> | ||
<input name="privacy" id="privacy" type="checkbox" /> | ||
I have read and agreed to the <a href="https://www.zooniverse.org/privacy">Privacy Policy</a> | ||
</label> | ||
</div> | ||
|
||
<div class="checkbox"> | ||
<%= f.label :global_email_communication do %> | ||
<%= f.check_box :global_email_communication, checked: true %> | ||
It’s okay to send me email every once in a while. | ||
<% end %> | ||
</div> | ||
|
||
<div class="row" > | ||
<fieldset class="fieldset--password"> | ||
<%= f.label :password, "Password (required)"%><small class="errored"><%= resource.errors[:password].join(', ')%></small><br /> | ||
<%= f.password_field :password, autocomplete: "off", required: true %> | ||
</fieldset> | ||
|
||
<fieldset class="fieldset--password"> | ||
<%= f.label :password_confirmation, "Password confirmation (required)" %><small class="errored"><%= resource.errors[:password_confirmation].join(', ')%></small><br /> | ||
<%= f.password_field :password_confirmation, autocomplete: "off", required: true %> | ||
</fieldset> | ||
</div> | ||
|
||
<div class="row" > | ||
<fieldset class="fieldset--email"> | ||
<input name="privacy" type="checkbox" /> | ||
<label for="privacy">I have read and agreed to the <a href="https://www.zooniverse.org/privacy">Privacy Policy</a></label><br /> | ||
|
||
<%= f.check_box :global_email_communication, checked: true %> | ||
<%= f.label :global_email_communication, "It’s okay to send me email every once in a while." %><br /> | ||
|
||
<%= f.check_box :beta_email_communication, checked: false %> | ||
<%= f.label :beta_email_communication, "I’d like to help test new projects, and be emailed when they’re available." %><br /> | ||
</fieldset> | ||
<div class="checkbox"> | ||
<%= f.label :beta_email_communication do %> | ||
<%= f.check_box :beta_email_communication, checked: false %> | ||
I’d like to help test new projects, and be emailed when they’re available. | ||
<% end %> | ||
</div> | ||
|
||
<div class="submit-container"><%= f.submit "Sign up" %></div> | ||
<%= f.submit "Create account", class: 'btn btn-primary' %> | ||
<% end %> | ||
</div> | ||
|
||
<div class="panel-footer"> | ||
<%= render "devise/shared/links" %> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,25 @@ | ||
<div class="form-container"> | ||
<h2>Sign in</h2> | ||
<div class="form-container panel panel-default"> | ||
<div class="panel-body"> | ||
<h2>Sign in</h2> | ||
|
||
<%= form_for(resource, as: resource_name, url: session_path(resource_name), html: {class: "form form--new-session"}) do |f| %> | ||
<fieldset class="fieldset--text"> | ||
<%= f.label :login, "Username or Email Address" %><br /> | ||
<%= f.text_field :login, autofocus: true, required: true %> | ||
</fieldset> | ||
<%= form_for(resource, as: resource_name, url: session_path(resource_name), html: {class: "form form--new-session"}) do |f| %> | ||
<fieldset class="fieldset--text"> | ||
<%= f.label :login, "Username or Email Address" %><br /> | ||
<%= f.text_field :login, autofocus: true, required: true %> | ||
</fieldset> | ||
|
||
<fieldset class="fieldset--password"> | ||
<%= f.label :password %><br /> | ||
<%= f.password_field :password, autocomplete: "off" %> | ||
</fieldset> | ||
<fieldset class="fieldset--password"> | ||
<%= f.label :password %><br /> | ||
<%= f.password_field :password, autocomplete: "off" %> | ||
</fieldset> | ||
|
||
<% if devise_mapping.rememberable? -%> | ||
<fieldset class="fieldset--remember"><%= f.check_box :remember_me %> <%= f.label :remember_me %></fieldset> | ||
<% end -%> | ||
<% if devise_mapping.rememberable? -%> | ||
<fieldset class="fieldset--remember"><%= f.check_box :remember_me %> <%= f.label :remember_me %></fieldset> | ||
<% end -%> | ||
|
||
<div class="submit-container"><%= f.submit "Sign in" %></div> | ||
<% end %> | ||
<div class="submit-container"><%= f.submit "Sign in" %></div> | ||
<% end %> | ||
|
||
<%= render "devise/shared/links" %> | ||
<%= render "devise/shared/links" %> | ||
</div> | ||
</div> |
Oops, something went wrong.