Skip to content

Commit d1cecae

Browse files
committed
Added devise views to the app
1 parent 590e4dc commit d1cecae

File tree

12 files changed

+178
-1
lines changed

12 files changed

+178
-1
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<h2>Resend confirmation instructions</h2>
2+
3+
<%= form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post }) do |f| %>
4+
<%= devise_error_messages! %>
5+
6+
<div><%= f.label :email %><br />
7+
<%= f.email_field :email, :autofocus => true %></div>
8+
9+
<div><%= f.submit "Resend confirmation instructions" %></div>
10+
<% end %>
11+
12+
<%= render "devise/shared/links" %>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<p>Welcome <%= @email %>!</p>
2+
3+
<p>You can confirm your account email through the link below:</p>
4+
5+
<p><%= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @resource.confirmation_token) %></p>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<p>Hello <%= @resource.email %>!</p>
2+
3+
<p>Someone has requested a link to change your password. You can do this through the link below.</p>
4+
5+
<p><%= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @resource.reset_password_token) %></p>
6+
7+
<p>If you didn't request this, please ignore this email.</p>
8+
<p>Your password won't change until you access the link above and create a new one.</p>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<p>Hello <%= @resource.email %>!</p>
2+
3+
<p>Your account has been locked due to an excessive number of unsuccessful sign in attempts.</p>
4+
5+
<p>Click the link below to unlock your account:</p>
6+
7+
<p><%= link_to 'Unlock my account', unlock_url(@resource, :unlock_token => @resource.unlock_token) %></p>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<h2>Change your password</h2>
2+
3+
<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put }) do |f| %>
4+
<%= devise_error_messages! %>
5+
<%= f.hidden_field :reset_password_token %>
6+
7+
<div><%= f.label :password, "New password" %><br />
8+
<%= f.password_field :password, :autofocus => true %></div>
9+
10+
<div><%= f.label :password_confirmation, "Confirm new password" %><br />
11+
<%= f.password_field :password_confirmation %></div>
12+
13+
<div><%= f.submit "Change my password" %></div>
14+
<% end %>
15+
16+
<%= render "devise/shared/links" %>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<h2>Forgot your password?</h2>
2+
3+
<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post }) do |f| %>
4+
<%= devise_error_messages! %>
5+
6+
<div><%= f.label :email %><br />
7+
<%= f.email_field :email, :autofocus => true %></div>
8+
9+
<div><%= f.submit "Send me reset password instructions" %></div>
10+
<% end %>
11+
12+
<%= render "devise/shared/links" %>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<h2>Edit <%= resource_name.to_s.humanize %></h2>
2+
3+
<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f| %>
4+
<%= devise_error_messages! %>
5+
6+
<div><%= f.label :email %><br />
7+
<%= f.email_field :email, :autofocus => true %></div>
8+
9+
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
10+
<div>Currently waiting confirmation for: <%= resource.unconfirmed_email %></div>
11+
<% end %>
12+
13+
<div><%= f.label :password %> <i>(leave blank if you don't want to change it)</i><br />
14+
<%= f.password_field :password, :autocomplete => "off" %></div>
15+
16+
<div><%= f.label :password_confirmation %><br />
17+
<%= f.password_field :password_confirmation %></div>
18+
19+
<div><%= f.label :current_password %> <i>(we need your current password to confirm your changes)</i><br />
20+
<%= f.password_field :current_password %></div>
21+
22+
<div><%= f.submit "Update" %></div>
23+
<% end %>
24+
25+
<h3>Cancel my account</h3>
26+
27+
<p>Unhappy? <%= button_to "Cancel my account", registration_path(resource_name), :data => { :confirm => "Are you sure?" }, :method => :delete %></p>
28+
29+
<%= link_to "Back", :back %>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<h2>Sign up</h2>
2+
3+
<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %>
4+
<%= devise_error_messages! %>
5+
6+
<div><%= f.label :email %><br />
7+
<%= f.email_field :email, :autofocus => true %></div>
8+
9+
<div><%= f.label :password %><br />
10+
<%= f.password_field :password %></div>
11+
12+
<div><%= f.label :password_confirmation %><br />
13+
<%= f.password_field :password_confirmation %></div>
14+
15+
<div><%= f.submit "Sign up" %></div>
16+
<% end %>
17+
18+
<%= render "devise/shared/links" %>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<div class="row">
2+
<div class="col-12 col-sm-12 col-lg-4 col-offset-4">
3+
<h2>Sign in</h2>
4+
5+
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
6+
<div class="form-group">
7+
<%= f.label :email %>
8+
<%= f.email_field :email, :autofocus => true, :class => "form-control" %>
9+
</div>
10+
11+
<div class="form-group">
12+
<%= f.label :password %>
13+
<%= f.password_field :password, :class => "form-control" %>
14+
</div>
15+
16+
<% if devise_mapping.rememberable? -%>
17+
<div class="form-group">
18+
<%= f.check_box :remember_me %>
19+
<%= f.label :remember_me %>
20+
</div>
21+
<% end -%>
22+
23+
<div class="form-group">
24+
<%= f.submit "Sign in", :class => "btn btn-primary" %>
25+
</div>
26+
<% end %>
27+
28+
<%= render "devise/shared/links" %>
29+
30+
</div>
31+
</div>

app/views/devise/shared/_links.erb

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<%- if controller_name != 'sessions' %>
2+
<%= link_to "Sign in", new_session_path(resource_name) %><br />
3+
<% end -%>
4+
5+
<%- if devise_mapping.registerable? && controller_name != 'registrations' %>
6+
<%= link_to "Sign up", new_registration_path(resource_name) %><br />
7+
<% end -%>
8+
9+
<%- if devise_mapping.recoverable? && controller_name != 'passwords' %>
10+
<%= link_to "Forgot your password?", new_password_path(resource_name) %><br />
11+
<% end -%>
12+
13+
<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
14+
<%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %><br />
15+
<% end -%>
16+
17+
<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
18+
<%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %><br />
19+
<% end -%>
20+
21+
<%- if devise_mapping.omniauthable? %>
22+
<%- resource_class.omniauth_providers.each do |provider| %>
23+
<%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) %><br />
24+
<% end -%>
25+
<% end -%>

0 commit comments

Comments
 (0)