rails_layout 1.0.14 → 1.0.15

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: 8813ff21264efe36c532f1841b818f0f7721c458
4
- data.tar.gz: 9518064270333234e5a55fbaf5eb855a372a7f09
3
+ metadata.gz: 648e4f681b5ad19c5d2ae77d3e995e3fc9b6d700
4
+ data.tar.gz: 3472f3f3e947acce87a86c3a62296e48281b8da5
5
5
  SHA512:
6
- metadata.gz: 0d710544f1cb92c8299cedb645f1dfe0130719b4092dacc761fc33d8018380cf11787ea81c214cdc13a97e7c6a7b542ac6ba9b8a24d2f2af409e0a0c71a52e51
7
- data.tar.gz: 25034958cafe2cb631b2063b2f7b0205d1c2751b3ff86f9c781cec8fd7a3ba1e730c212886f860d5506adddb4695d4a939e2704b526771dc8beeaa326a47ae68
6
+ metadata.gz: 5487f8fa993f3191bcc7c700a6355992e94be99580e3d38b30fe389c36e451125cb387906de93da7bfffee122e7a45d0aa0c98b226ab8dcd3922bd4307143c75
7
+ data.tar.gz: 34ebc9843536c0cc7f64c024dbf13363ddd22a9b40558092e960f49288aa9c6447b4fe662ebf653d395f4fe6b84f6df75edbaa82778786df27eba12a2910a713
data/CHANGELOG.textile CHANGED
@@ -1,8 +1,13 @@
1
1
  h1. CHANGELOG
2
2
 
3
+ h3. 1.0.15 May 3, 2014
4
+
5
+ * update navlinks partial to accommodate role-based authorization
6
+ * drop workaround after release of bootstrap-sass 3.1.1.1 (fixes #20)
7
+
3
8
  h3. 1.0.14 April 9, 2014
4
9
 
5
- * workaround for Rails 4.1.2 pending releaase of bootstrap-sass 3.1.2 (fixes #20)
10
+ * workaround for Rails 4.1.0 pending release of bootstrap-sass 3.1.1.1 (fixes #20)
6
11
  * modify 'config/application.rb' for Foundation 5 (fixes #19)
7
12
  * remove unnecessary conditional on Bootstrap navlinks partial (contributed by Arnel Bucio)
8
13
 
data/README.textile CHANGED
@@ -5,19 +5,16 @@ Use this gem to set up layout files for your choice of front-end framework:
5
5
  * Zurb Foundation 5.0
6
6
  * Bootstrap 3.0
7
7
 
8
- Or earlier versions:
9
-
10
- * Zurb Foundation 4.0
11
- * Bootstrap 2.3
12
-
13
- Plus it will set up "Devise":https://github.com/plataformatec/devise views with styling for Bootstrap or Foundation.
8
+ It also will set up "Devise":https://github.com/plataformatec/devise views with styling for Bootstrap or Foundation.
14
9
 
15
10
  RailsLayout is a utility gem to use during development.
16
11
 
17
- h4. Rails Composer
12
+ h4. Other Tools
18
13
 
19
14
  The RailsLayout gem is used by "Rails Composer":http://railsapps.github.io/rails-composer/ tool, an application template used to create starter applications. You can use Rails Composer to generate entire applications.
20
15
 
16
+ If you like the RailsLayout gem, you might be interested in the "RailsApps Testing gem":https://github.com/RailsApps/rails_apps_testing which sets up a testing framework for Rails.
17
+
21
18
  h4. !http://railsapps.github.io/images/join/join-railsapps.png(Join RailsApps)!:http://railsapps.github.io/
22
19
 
23
20
  h4. Support the RailsApps Project
@@ -61,6 +58,8 @@ h4. Zurb Foundation 5.0
61
58
  gem 'foundation-rails'
62
59
  </pre>
63
60
 
61
+ See a note below about a necessary change to the *config/application.rb* file.
62
+
64
63
  h4. Zurb Foundation 4.0
65
64
 
66
65
  <pre>
@@ -214,6 +213,25 @@ and modify the file:
214
213
 
215
214
  * "app/assets/javascripts/application.js":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/install/templates/foundation5-application.js
216
215
 
216
+ h4. config/application.rb
217
+
218
+ The rails_layout gem will make a necessary change to the *config/application.rb* file. It will add:
219
+
220
+ <pre>
221
+ module RailsFoundation
222
+ class Application < Rails::Application
223
+ .
224
+ .
225
+ .
226
+ # For Foundation 5
227
+ config.assets.precompile += %w( vendor/modernizr )
228
+
229
+ end
230
+ end
231
+ </pre>
232
+
233
+ See "issue 19":https://github.com/RailsApps/rails_layout/issues/19 for an explanation.
234
+
217
235
  h3. Zurb Foundation 4.0 Layout
218
236
 
219
237
  To create layout files for use with Zurb Foundation 4.0:
@@ -1,9 +1,3 @@
1
- // Temporary workaround for Rails 4.1.2 pending releaase of bootstrap-sass 3.1.2
2
- //= depend_on_asset "bootstrap/glyphicons-halflings-regular.eot"
3
- //= depend_on_asset "bootstrap/glyphicons-halflings-regular.svg"
4
- //= depend_on_asset "bootstrap/glyphicons-halflings-regular.ttf"
5
- //= depend_on_asset "bootstrap/glyphicons-halflings-regular.woff"
6
-
7
1
  // import the CSS framework
8
2
  @import "bootstrap";
9
3
 
@@ -30,12 +30,29 @@ LINKS
30
30
  end
31
31
  end
32
32
  # USERS
33
- if Dir.glob("app/views/users/index.html.{#{ext},erb}").any?
34
- append_file 'app/views/layouts/_navigation_links.html.erb' do <<-LINKS
33
+ if Object.const_defined?('User')
34
+ if User.column_names.include? 'role'
35
+ # suitable for role-based authorization
36
+ if Dir.glob("app/views/users/index.html.{#{ext},erb}").any?
37
+ append_file 'app/views/layouts/_navigation_links.html.erb' do <<-LINKS
38
+ <% if user_signed_in? %>
39
+ <% if current_user.admin? %>
40
+ <li><%= link_to 'Users', users_path %></li>
41
+ <% end %>
42
+ <% end %>
43
+ LINKS
44
+ end
45
+ end
46
+ else
47
+ # suitable for simple authentication
48
+ if Dir.glob("app/views/users/index.html.{#{ext},erb}").any?
49
+ append_file 'app/views/layouts/_navigation_links.html.erb' do <<-LINKS
35
50
  <% if user_signed_in? %>
36
51
  <li><%= link_to 'Users', users_path %></li>
37
52
  <% end %>
38
53
  LINKS
54
+ end
55
+ end
39
56
  end
40
57
  end
41
58
  # OMNIAUTH
@@ -1,3 +1,3 @@
1
1
  module RailsLayout
2
- VERSION = "1.0.14"
2
+ VERSION = "1.0.15"
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.14
4
+ version: 1.0.15
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-04-10 00:00:00.000000000 Z
11
+ date: 2014-05-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler