-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
User accounts! See #22 for exciting next steps =)
- Loading branch information
Showing
28 changed files
with
1,030 additions
and
333 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
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
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class DeviseUser < ActiveRecord::Base | ||
devise :database_authenticatable, :registerable, | ||
:recoverable, :rememberable, :trackable, :validatable, | ||
:confirmable | ||
end |
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,18 @@ | ||
<div class="container"> | ||
<%= bootstrap_devise_error_messages! %> | ||
<div class="panel panel-default"> | ||
<div class="panel-heading"> | ||
<h4><%= t('.resend_confirmation_instructions', :default => 'Resend confirmation instructions') %></h4> | ||
</div> | ||
<div class="panel-body"> | ||
<%= form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post, role: "form" }) do |f| %> | ||
<div class="form-group"> | ||
<%= f.label :email %> | ||
<%= f.email_field :email, autofocus: true, class: "form-control" %> | ||
</div> | ||
|
||
<%= f.submit t('.resend_confirmation_instructions', :default => 'Resend confirmation instructions'), class: "btn btn-primary" %> | ||
<% end %> | ||
</div> | ||
</div> | ||
</div> |
6 changes: 6 additions & 0 deletions
6
WcaOnRails/app/views/devise/mailer/confirmation_instructions.html.erb
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 @@ | ||
<p><%= t('.greeting', :recipient => @resource.email, :default => "Welcome #{@resource.email}!") %></p> | ||
|
||
<p><%= t('.instruction', :default => "You can confirm your account email through the link below:") %></p> | ||
|
||
<p><%= link_to t('.action', :default => "Confirm my account"), | ||
confirmation_url(@resource, :confirmation_token => @token, locale: I18n.locale) %></p> |
8 changes: 8 additions & 0 deletions
8
WcaOnRails/app/views/devise/mailer/reset_password_instructions.html.erb
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,8 @@ | ||
<p><%= t('.greeting', :recipient => @resource.email, :default => "Hello #{@resource.email}!") %></p> | ||
|
||
<p><%= t('.instruction', :default => "Someone has requested a link to change your password, and you can do this through the link below.") %></p> | ||
|
||
<p><%= link_to t('.action', :default => "Change my password"), edit_password_url(@resource, :reset_password_token => @token, locale: I18n.locale) %></p> | ||
|
||
<p><%= t('.instruction_2', :default => "If you didn't request this, please ignore this email.") %></p> | ||
<p><%= t('.instruction_3', :default => "Your password won't change until you access the link above and create a new one.") %></p> |
7 changes: 7 additions & 0 deletions
7
WcaOnRails/app/views/devise/mailer/unlock_instructions.html.erb
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,7 @@ | ||
<p><%= t('.greeting', :recipient => @resource.email, :default => "Hello #{@resource.email}!") %></p> | ||
|
||
<p><%= t('.message', :default => "Your account has been locked due to an excessive amount of unsuccessful sign in attempts.") %></p> | ||
|
||
<p><%= t('.instruction', :default => "Click the link below to unlock your account:") %></p> | ||
|
||
<p><%= link_to t('.action', :default => "Unlock my account"), unlock_url(@resource, :unlock_token => @resource.unlock_token, locale: I18n.locale) %></p> |
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,26 @@ | ||
<div class="container"> | ||
<%= bootstrap_devise_error_messages! %> | ||
<div class="panel panel-default"> | ||
<div class="panel-heading"> | ||
<h4><%= t('.change_your_password', :default => 'Change your password') %></h4> | ||
</div> | ||
<div class="panel-body"> | ||
<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put, role: "form" }) do |f| %> | ||
<%= f.hidden_field :reset_password_token %> | ||
|
||
<div class="form-group"> | ||
<%= f.label :password, t('.new_password', :default => 'New password') %> | ||
<%= f.password_field :password, autofocus: true, class: "form-control" %> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<%= f.label :password_confirmation, t('.confirm_new_password', :default => 'Confirm new password') %> | ||
<%= f.password_field :password_confirmation, class: "form-control" %> | ||
</div> | ||
|
||
<%= f.submit t('.change_my_password', :default => 'Change my password'), class: "btn btn-primary" %> | ||
<% end %> | ||
</div> | ||
</div> | ||
<%= render "devise/shared/links" %> | ||
</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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<div class="container"> | ||
<%= bootstrap_devise_error_messages! %> | ||
<div class="panel panel-default"> | ||
<div class="panel-heading"> | ||
<h4><%= t('.forgot_your_password', :default => 'Forgot your password?') %></h4> | ||
</div> | ||
<div class="panel-body"> | ||
<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post, role: "form" }) do |f| %> | ||
<div class="form-group"> | ||
<%= f.label :email %> | ||
<%= f.email_field :email, autofocus: true, class: "form-control" %> | ||
</div> | ||
|
||
<%= f.submit t('.send_me_reset_password_instructions', :default => "Send me reset password instructions"), class: "btn btn-primary" %> | ||
<% end %> | ||
</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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<div class="container"> | ||
<%= bootstrap_devise_error_messages! %> | ||
<div class="panel panel-default"> | ||
<div class="panel-heading"> | ||
<h4><%= t('.title', :resource => resource_class.model_name.human , :default => 'Edit #{resource_name.to_s.humanize}') %></h4> | ||
</div> | ||
<div class="panel-body"> | ||
<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f| %> | ||
<div class="form-group"> | ||
<%= f.label :email %> | ||
<%= f.email_field :email, autofocus: true, class: "form-control" %> | ||
</div> | ||
<div class="form-group"> | ||
<%= f.label :password %> <i>(<%= t('.leave_blank_if_you_don_t_want_to_change_it', :default => "leave blank if you don't want to change it") %>)</i><br /> | ||
<%= f.password_field :password, :autocomplete => "off", class: "form-control" %> | ||
</div> | ||
<div class="form-group"> | ||
<%= f.label :password_confirmation %><br /> | ||
<%= f.password_field :password_confirmation, class: "form-control" %> | ||
</div> | ||
<div class="form-group"> | ||
<%= f.label :current_password %> <i>(<%= t('.we_need_your_current_password_to_confirm_your_changes', :default => 'we need your current password to confirm your changes') %>)</i> | ||
<%= f.password_field :current_password, class: "form-control" %> | ||
</div> | ||
<%= f.submit t('.update', :default => "Update"), class: "btn btn-primary" %></div> | ||
<% end %> | ||
</div> | ||
|
||
<p><%= t('.unhappy', :default => 'Unhappy') %>? <%= link_to t('.cancel_my_account', :default => "Cancel my account"), registration_path(resource_name), :data => { :confirm => t('.are_you_sure', :default => "Are you sure?") }, :method => :delete %>.</p> | ||
</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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<div class="container"> | ||
<%= bootstrap_devise_error_messages! %> | ||
<div class="panel panel-default"> | ||
<div class="panel-heading"> | ||
<h4><%= t('.sign_up', :default => "Sign up") %></h4> | ||
</div> | ||
<div class="panel-body"> | ||
<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), html: { role: "form" }) do |f| %> | ||
<div class="form-group"> | ||
<%= f.label :email %> | ||
<%= f.email_field :email, autofocus: true, class: "form-control" %> | ||
</div> | ||
<div class="form-group"> | ||
<%= f.label :password %><br /> | ||
<%= f.password_field :password, class: "form-control" %> | ||
</div> | ||
<div class="form-group"> | ||
<%= f.label :password_confirmation %> | ||
<%= f.password_field :password_confirmation, class: "form-control" %> | ||
</div> | ||
<%= f.submit t('.sign_up', :default => "Sign up"), class: "btn btn-primary" %> | ||
<% end %> | ||
</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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<div class="container"> | ||
<div class="panel panel-default"> | ||
<div class="panel-heading"> | ||
<h4><%= t('.sign_in', :default => "Sign in") %></h4> | ||
</div> | ||
<div class="panel-body"> | ||
<%= form_for(resource, as: resource_name, url: session_path(resource_name), html: { role: "form" }) do |f| %> | ||
<div class="form-group"> | ||
<%= f.label :email %> | ||
<%= f.email_field :email, autofocus: true, class: "form-control", tabindex: "1" %> | ||
</div> | ||
<div class="form-group"> | ||
<%= f.label :password %> | ||
<%= link_to t(".forgot_your_password", :default => "Forgot your password?"), new_password_path(resource_name) %><br /> | ||
<%= f.password_field :password, autocomplete: "off", class: "form-control", tabindex: "2" %> | ||
</div> | ||
<% if devise_mapping.rememberable? %> | ||
<div class="checkbox"> | ||
<label> | ||
<%= f.check_box :remember_me, tabindex: "3" %> | ||
<%= f.label :remember_me %> | ||
</div> | ||
<% end %> | ||
<%= f.submit t('.sign_in', :default => "Sign in"), class: "btn btn-primary", tabindex: "3" %> | ||
No account? <%= link_to t(".sign_up", :default => "Sign up"), new_registration_path(resource_name) %>! | ||
<% end %> | ||
</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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<div class="container"> | ||
<%= bootstrap_devise_error_messages! %> | ||
<div class="panel panel-default"> | ||
<div class="panel-heading"> | ||
<h4><%= t('.resend_unlock_instructions', :default => "Resend unlock instructions") %></h4> | ||
</div> | ||
<div class="panel-body"> | ||
<%= form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post, html: { role: "form" } }) do |f| %> | ||
<div class="form-group"> | ||
<%= f.label :email %> | ||
<%= f.email_field :email, autofocus: true, class: "form-control" %> | ||
</div> | ||
<%= f.submit t('.resend_unlock_instructions', :default => "Resend unlock instructions"), class: "btn btn-primary"%> | ||
<% end %> | ||
</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
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
Oops, something went wrong.