rails_layout 1.0.15 → 1.0.16

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 648e4f681b5ad19c5d2ae77d3e995e3fc9b6d700
4
- data.tar.gz: 3472f3f3e947acce87a86c3a62296e48281b8da5
3
+ metadata.gz: 87ae1a1fb08c91a7cdc93b26bf54e89275469a93
4
+ data.tar.gz: faaf805b438ed561f5d192b0abfb80935da59596
5
5
  SHA512:
6
- metadata.gz: 5487f8fa993f3191bcc7c700a6355992e94be99580e3d38b30fe389c36e451125cb387906de93da7bfffee122e7a45d0aa0c98b226ab8dcd3922bd4307143c75
7
- data.tar.gz: 34ebc9843536c0cc7f64c024dbf13363ddd22a9b40558092e960f49288aa9c6447b4fe662ebf653d395f4fe6b84f6df75edbaa82778786df27eba12a2910a713
6
+ metadata.gz: f3eff8350dbddee8b339cafe7c875ca1679761fca70a16776f5c26fb6c9bb5de0119298bd15773e9790b456cde77dee4b992f59bb17c498e069379dbf054abe3
7
+ data.tar.gz: 9ace5b12b6e308e650d8cf8a237a348beac4ba3c6b653b3d953132e5c7b50d36e5454c9fa1585dbafc2f5735aa789d3c0214e444c2a70eca304951ae6b1e7ad0
data/CHANGELOG.textile CHANGED
@@ -1,5 +1,11 @@
1
1
  h1. CHANGELOG
2
2
 
3
+ h3. 1.0.16 May 10, 2014
4
+
5
+ * add missing Devise form for password reset
6
+ * add navigation spec when Devise is used and RSpec is installed
7
+ * change "log in" to "sign in" and "logout" to "sign out"
8
+
3
9
  h3. 1.0.15 May 3, 2014
4
10
 
5
11
  * update navlinks partial to accommodate role-based authorization
data/README.textile CHANGED
@@ -384,9 +384,9 @@ Here's an example of a file *app/views/layouts/_navigation_links.html.erb* appro
384
384
  <li><%= link_to 'Contact', new_contact_path %></li>
385
385
  <% if user_signed_in? %>
386
386
  <li><%= link_to 'Edit account', edit_user_registration_path %></li>
387
- <li><%= link_to 'Logout', destroy_user_session_path, :method=>'delete' %></li>
387
+ <li><%= link_to 'Sign out', destroy_user_session_path, :method=>'delete' %></li>
388
388
  <% else %>
389
- <li><%= link_to 'Login', new_user_session_path %></li>
389
+ <li><%= link_to 'Sign in', new_user_session_path %></li>
390
390
  <li><%= link_to 'Sign up', new_user_registration_path %></li>
391
391
  <% end %>
392
392
  <% if user_signed_in? %>
@@ -29,6 +29,7 @@ module Layout
29
29
  def add_devise_views
30
30
  copy_file 'sessions/new.html.erb', 'app/views/devise/sessions/new.html.erb'
31
31
  copy_file 'passwords/new.html.erb', 'app/views/devise/passwords/new.html.erb'
32
+ copy_file 'passwords/edit.html.erb', 'app/views/devise/passwords/edit.html.erb'
32
33
  copy_file 'registrations/new.html.erb', 'app/views/devise/registrations/new.html.erb'
33
34
  copy_file 'registrations/edit.html.erb', 'app/views/devise/registrations/edit.html.erb'
34
35
  end
@@ -0,0 +1,14 @@
1
+ <div class="authform">
2
+ <%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put }) do |f| %>
3
+ <h3>Change your password</h3>
4
+ <%= devise_error_messages! %>
5
+ <%= f.hidden_field :reset_password_token %>
6
+ <div class="form-group">
7
+ <%= f.label :password, 'New password' %>
8
+ <%= f.password_field :password, autofocus: true, autocomplete: 'off', class: 'form-control' %>
9
+ <%= f.label :password_confirmation, 'Confirm new password' %>
10
+ <%= f.password_field :password_confirmation, autocomplete: 'off', class: 'form-control' %>
11
+ </div>
12
+ <%= f.submit 'Change my Password', :class => 'button right' %>
13
+ <% end %>
14
+ </div>
@@ -1,6 +1,6 @@
1
1
  <div class="authform">
2
2
  <%= form_for(resource, :as => resource_name, :url => session_path(resource_name), :html => { :role => 'form'}) do |f| %>
3
- <h3>Log in</h3>
3
+ <h3>Sign in</h3>
4
4
  <%= devise_error_messages! %>
5
5
  <div class="form-group">
6
6
  <%- if devise_mapping.registerable? %>
@@ -16,7 +16,7 @@
16
16
  <%= f.label :password %>
17
17
  <%= f.password_field :password, class: 'form-control' %>
18
18
  </div>
19
- <%= f.submit 'Log in', :class => 'button right' %>
19
+ <%= f.submit 'Sign in', :class => 'button right' %>
20
20
  <% if devise_mapping.rememberable? -%>
21
21
  <div class="checkbox">
22
22
  <%= f.check_box :remember_me %> <%= f.label :remember_me %>
@@ -21,9 +21,9 @@ module Layout
21
21
  append_file 'app/views/layouts/_navigation_links.html.erb' do <<-LINKS
22
22
  <% if user_signed_in? %>
23
23
  <li><%= link_to 'Edit account', edit_user_registration_path %></li>
24
- <li><%= link_to 'Logout', destroy_user_session_path, :method=>'delete' %></li>
24
+ <li><%= link_to 'Sign out', destroy_user_session_path, :method=>'delete' %></li>
25
25
  <% else %>
26
- <li><%= link_to 'Login', new_user_session_path %></li>
26
+ <li><%= link_to 'Sign in', new_user_session_path %></li>
27
27
  <li><%= link_to 'Sign up', new_user_registration_path %></li>
28
28
  <% end %>
29
29
  LINKS
@@ -59,15 +59,21 @@ LINKS
59
59
  if File.exists?('config/initializers/omniauth.rb')
60
60
  append_file 'app/views/layouts/_navigation_links.html.erb' do <<-LINKS
61
61
  <% if user_signed_in? %>
62
- <li><%= link_to 'Logout', signout_path %></li>
62
+ <li><%= link_to 'Sign out', signout_path %></li>
63
63
  <% else %>
64
- <li><%= link_to 'Login', signin_path %></li>
64
+ <li><%= link_to 'Sign in', signin_path %></li>
65
65
  <% end %>
66
66
  LINKS
67
67
  end
68
68
  end
69
69
  end
70
70
 
71
+ def add_tests
72
+ return unless File.exists?('config/initializers/devise.rb')
73
+ return unless File.exists?('spec/spec_helper.rb')
74
+ copy_file 'navigation_spec.rb', 'spec/features/visitors/navigation_spec.rb'
75
+ end
76
+
71
77
  end
72
78
  end
73
79
  end
@@ -0,0 +1,20 @@
1
+ require 'spec_helper'
2
+
3
+ # Feature: Navigation links
4
+ # As a visitor
5
+ # I want to see navigation links
6
+ # So I can find home, sign in, or sign up
7
+ feature 'Navigation links', :devise do
8
+
9
+ # Scenario: View navigation links
10
+ # Given I am a visitor
11
+ # When I visit the home page
12
+ # Then I see "home," "sign in," and "sign up"
13
+ scenario 'view navigation links' do
14
+ visit root_path
15
+ expect(page).to have_content 'Home'
16
+ expect(page).to have_content 'Sign in'
17
+ expect(page).to have_content 'Sign up'
18
+ end
19
+
20
+ end
@@ -1,3 +1,3 @@
1
1
  module RailsLayout
2
- VERSION = "1.0.15"
2
+ VERSION = "1.0.16"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_layout
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.15
4
+ version: 1.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Kehoe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-03 00:00:00.000000000 Z
11
+ date: 2014-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -55,6 +55,7 @@ files:
55
55
  - lib/generators/layout/devise/devise_generator.rb
56
56
  - lib/generators/layout/devise/templates/bootstrap3.css.scss
57
57
  - lib/generators/layout/devise/templates/foundation5.css.scss
58
+ - lib/generators/layout/devise/templates/passwords/edit.html.erb
58
59
  - lib/generators/layout/devise/templates/passwords/new.html.erb
59
60
  - lib/generators/layout/devise/templates/registrations/edit.html.erb
60
61
  - lib/generators/layout/devise/templates/registrations/new.html.erb
@@ -122,6 +123,7 @@ files:
122
123
  - lib/generators/layout/install/templates/simple.css
123
124
  - lib/generators/layout/navigation/navigation_generator.rb
124
125
  - lib/generators/layout/navigation/templates/navigation_links.html.erb
126
+ - lib/generators/layout/navigation/templates/navigation_spec.rb
125
127
  - lib/rails_layout.rb
126
128
  - lib/rails_layout/version.rb
127
129
  - rails_layout.gemspec