-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow users to edit and delete their account #2762
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
43bf870
Spice up edit page styling and add delete-account
marten 25fa0b6
Add specs
marten 457058d
Remove commented out shared examples for deactivate
marten b6403b9
Increase base font size
marten 3a6322c
Convert password-forgot screens to Bootstrap
marten 262e8d7
Fix indentation to 2 spaces
marten 759fd91
Convert other forms to Bootstrap
marten 6a004cc
Test that current user is logged out
marten File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this file want to be in here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it's some kind of standardized way of telling editors what settings to use for common things. Mine was indenting erb with 4 spaces, and figured this might be a good way of both fixing it and documenting it, even if people don't run the plugin. http://editorconfig.org/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sneaky