rails_layout 1.0.5 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.textile +4 -0
- data/README.textile +34 -31
- data/lib/generators/layout/navigation/navigation_generator.rb +11 -0
- data/lib/rails_layout/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 789a055991b9c9b5e0d81196a96e830f35faaa3b
|
4
|
+
data.tar.gz: a8a4e70ae9a9aad01663186a5f7fa444167eccbf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b2b7ab3ca2b3acac3aadf7fae4414a7b1d2794ecd63e820ebaf3c253f5929f547979f5eb656f3c06fb5916529951064c0587df8e521ff1ac730408a957df0b1
|
7
|
+
data.tar.gz: 5f80815d397798be0575c69883d67e7fa7969a398f64b71106907f27537c710459ed2164162f0a5247cd5f39e0a5d06db8aa04859fa840a5fa093608d6737151
|
data/CHANGELOG.textile
CHANGED
data/README.textile
CHANGED
@@ -3,8 +3,11 @@ h1. !http://railsapps.github.io/images/rails-36x36.jpg(RailsLayout Gem)! RailsLa
|
|
3
3
|
Use this gem to set up layout files for your choice of front-end framework:
|
4
4
|
|
5
5
|
* Zurb Foundation 5.0
|
6
|
-
* Zurb Foundation 4.0
|
7
6
|
* Bootstrap 3.0
|
7
|
+
|
8
|
+
Or earlier versions:
|
9
|
+
|
10
|
+
* Zurb Foundation 4.0
|
8
11
|
* Bootstrap 2.3
|
9
12
|
|
10
13
|
Plus it will set up "Devise":https://github.com/plataformatec/devise views with styling for Bootstrap or Foundation.
|
@@ -34,7 +37,7 @@ h4. Generate Application Layout, Navigation, and Flash Message Files
|
|
34
37
|
|
35
38
|
h4. Add Links to the Navigation File
|
36
39
|
|
37
|
-
* @$
|
40
|
+
* @$ rails generate layout:navigation@
|
38
41
|
|
39
42
|
h4. Generate Devise Views
|
40
43
|
|
@@ -163,9 +166,9 @@ Two navigation partials are created:
|
|
163
166
|
* app/views/layouts/_navigation_links.html.erb
|
164
167
|
* app/views/layouts/_navigation.html.erb
|
165
168
|
|
166
|
-
The
|
169
|
+
The *_navigation_links.html.erb* file is only a list of links. You can add additional links to this file as needed. It contains no framework-specific styling.
|
167
170
|
|
168
|
-
The
|
171
|
+
The *_navigation.html.erb* file contains framework-specific styling. Separating the files makes it easy to change the front-end framework without disturbing the links.
|
169
172
|
|
170
173
|
h4. Support for ERB, Haml, or Slim
|
171
174
|
|
@@ -201,17 +204,17 @@ $ rails generate layout:install foundation5 --force
|
|
201
204
|
|
202
205
|
See the files that are generated:
|
203
206
|
|
204
|
-
* "app/views/layouts/application.html.erb":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/templates/foundation5-application.html.erb
|
205
|
-
* "app/views/layouts/_messages.html.erb":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/templates/foundation4-messages.html.erb
|
206
|
-
* "app/views/layouts/_navigation.html.erb":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/templates/foundation5-navigation.html.erb
|
207
|
+
* "app/views/layouts/application.html.erb":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/install/templates/foundation5-application.html.erb
|
208
|
+
* "app/views/layouts/_messages.html.erb":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/install/templates/foundation4-messages.html.erb
|
209
|
+
* "app/views/layouts/_navigation.html.erb":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/install/templates/foundation5-navigation.html.erb
|
207
210
|
|
208
211
|
The RailsLayout gem will create the file:
|
209
212
|
|
210
|
-
* "app/assets/stylesheets/framework_and_overrides.css.scss":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/templates/foundation5_and_overrides.css.scss
|
213
|
+
* "app/assets/stylesheets/framework_and_overrides.css.scss":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/install/templates/foundation5_and_overrides.css.scss
|
211
214
|
|
212
215
|
and modify the file:
|
213
216
|
|
214
|
-
* "app/assets/javascripts/application.js":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/templates/foundation5-application.js
|
217
|
+
* "app/assets/javascripts/application.js":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/install/templates/foundation5-application.js
|
215
218
|
|
216
219
|
h3. Zurb Foundation 4.0 Layout
|
217
220
|
|
@@ -229,17 +232,17 @@ $ rails generate layout:install foundation4 --force
|
|
229
232
|
|
230
233
|
See the files that are generated:
|
231
234
|
|
232
|
-
* "app/views/layouts/application.html.erb":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/templates/foundation4-application.html.erb
|
233
|
-
* "app/views/layouts/_messages.html.erb":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/templates/foundation4-messages.html.erb
|
234
|
-
* "app/views/layouts/_navigation.html.erb":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/templates/foundation4-navigation.html.erb
|
235
|
+
* "app/views/layouts/application.html.erb":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/install/templates/foundation4-application.html.erb
|
236
|
+
* "app/views/layouts/_messages.html.erb":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/install/templates/foundation4-messages.html.erb
|
237
|
+
* "app/views/layouts/_navigation.html.erb":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/install/templates/foundation4-navigation.html.erb
|
235
238
|
|
236
239
|
The RailsLayout gem will create the file:
|
237
240
|
|
238
|
-
* "app/assets/stylesheets/framework_and_overrides.css.scss":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/templates/foundation4_and_overrides.css.scss
|
241
|
+
* "app/assets/stylesheets/framework_and_overrides.css.scss":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/install/templates/foundation4_and_overrides.css.scss
|
239
242
|
|
240
243
|
and modify the file:
|
241
244
|
|
242
|
-
* "app/assets/javascripts/application.js":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/templates/foundation4-application.js
|
245
|
+
* "app/assets/javascripts/application.js":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/install/templates/foundation4-application.js
|
243
246
|
|
244
247
|
h3. Bootstrap 3.0 Layout
|
245
248
|
|
@@ -257,17 +260,17 @@ $ rails generate layout:install bootstrap3 --force
|
|
257
260
|
|
258
261
|
See the files that are generated:
|
259
262
|
|
260
|
-
* "app/views/layouts/application.html.erb":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/templates/bootstrap3-application.html.erb
|
261
|
-
* "app/views/layouts/_messages.html.erb":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/templates/bootstrap3-messages.html.erb
|
262
|
-
* "app/views/layouts/_navigation.html.erb":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/templates/bootstrap3-navigation.html.erb
|
263
|
+
* "app/views/layouts/application.html.erb":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/install/templates/bootstrap3-application.html.erb
|
264
|
+
* "app/views/layouts/_messages.html.erb":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/install/templates/bootstrap3-messages.html.erb
|
265
|
+
* "app/views/layouts/_navigation.html.erb":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/install/templates/bootstrap3-navigation.html.erb
|
263
266
|
|
264
267
|
The RailsLayout gem will create the file:
|
265
268
|
|
266
|
-
* "app/assets/stylesheets/framework_and_overrides.css.scss":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/templates/bootstrap3_and_overrides.css.scss
|
269
|
+
* "app/assets/stylesheets/framework_and_overrides.css.scss":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/install/templates/bootstrap3_and_overrides.css.scss
|
267
270
|
|
268
271
|
and modify the file:
|
269
272
|
|
270
|
-
* "app/assets/javascripts/application.js":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/templates/bootstrap-application.js
|
273
|
+
* "app/assets/javascripts/application.js":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/install/templates/bootstrap-application.js
|
271
274
|
|
272
275
|
h3. Bootstrap 2.3 Layout
|
273
276
|
|
@@ -285,17 +288,17 @@ $ rails generate layout:install bootstrap2 --force
|
|
285
288
|
|
286
289
|
See the files that are generated:
|
287
290
|
|
288
|
-
* "app/views/layouts/application.html.erb":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/templates/bootstrap2-application.html.erb
|
289
|
-
* "app/views/layouts/_messages.html.erb":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/templates/bootstrap2-messages.html.erb
|
290
|
-
* "app/views/layouts/_navigation.html.erb":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/templates/bootstrap2-navigation.html.erb
|
291
|
+
* "app/views/layouts/application.html.erb":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/install/templates/bootstrap2-application.html.erb
|
292
|
+
* "app/views/layouts/_messages.html.erb":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/install/templates/bootstrap2-messages.html.erb
|
293
|
+
* "app/views/layouts/_navigation.html.erb":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/install/templates/bootstrap2-navigation.html.erb
|
291
294
|
|
292
295
|
The RailsLayout gem will create the file:
|
293
296
|
|
294
|
-
* "app/assets/stylesheets/framework_and_overrides.css.scss":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/templates/bootstrap2_and_overrides.css.scss
|
297
|
+
* "app/assets/stylesheets/framework_and_overrides.css.scss":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/install/templates/bootstrap2_and_overrides.css.scss
|
295
298
|
|
296
299
|
and modify the file:
|
297
300
|
|
298
|
-
* "app/assets/javascripts/application.js":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/templates/bootstrap-application.js
|
301
|
+
* "app/assets/javascripts/application.js":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/install/templates/bootstrap-application.js
|
299
302
|
|
300
303
|
h3. Generate a Simple Layout
|
301
304
|
|
@@ -313,14 +316,14 @@ $ rails generate layout:install simple --force
|
|
313
316
|
|
314
317
|
See the files that are generated:
|
315
318
|
|
316
|
-
* "app/views/layouts/application.html.erb":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/templates/simple-application.html.erb
|
317
|
-
* "app/views/layouts/_messages.html.erb":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/templates/simple-messages.html.erb
|
318
|
-
* "app/views/layouts/_navigation.html.erb":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/templates/simple-navigation.html.erb
|
319
|
-
* "app/assets/stylesheets/simple.css":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/templates/simple.css
|
319
|
+
* "app/views/layouts/application.html.erb":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/install/templates/simple-application.html.erb
|
320
|
+
* "app/views/layouts/_messages.html.erb":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/install/templates/simple-messages.html.erb
|
321
|
+
* "app/views/layouts/_navigation.html.erb":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/install/templates/simple-navigation.html.erb
|
322
|
+
* "app/assets/stylesheets/simple.css":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/install/templates/simple.css
|
320
323
|
|
321
324
|
The RailsLayout gem will create the file:
|
322
325
|
|
323
|
-
* "app/assets/stylesheets/application.css.scss":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/templates/application.css.scss
|
326
|
+
* "app/assets/stylesheets/application.css.scss":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/install/templates/application.css.scss
|
324
327
|
|
325
328
|
h3. Reverting to None
|
326
329
|
|
@@ -348,7 +351,7 @@ The file *app/assets/stylesheets/application.css.scss* will contain a CSS rule b
|
|
348
351
|
|
349
352
|
h2. The "layout:navigation" Command
|
350
353
|
|
351
|
-
If you are using Devise for authentication, you can generate a navigation links partial containing links
|
354
|
+
If you are using Devise or OmniAuth for authentication, you can generate a navigation links partial containing appropriate links.
|
352
355
|
|
353
356
|
This command is used to populate the navigation bar in starter applications created by the "Rails Composer":http://railsapps.github.io/rails-composer/ tool.
|
354
357
|
|
@@ -356,7 +359,7 @@ This command is used to populate the navigation bar in starter applications crea
|
|
356
359
|
$ rails generate layout:navigation --force
|
357
360
|
</pre>
|
358
361
|
|
359
|
-
|
362
|
+
Here's an example of a file *app/views/layouts/_navigation_links.html.erb* appropriate for Devise:
|
360
363
|
|
361
364
|
<pre>
|
362
365
|
<%# add navigation links to this file %>
|
@@ -44,6 +44,17 @@ LINKS
|
|
44
44
|
<% if user_signed_in? %>
|
45
45
|
<li><%= link_to 'Users', users_path %></li>
|
46
46
|
<% end %>
|
47
|
+
LINKS
|
48
|
+
end
|
49
|
+
end
|
50
|
+
# OMNIAUTH
|
51
|
+
if Dir.glob("config/initializers/omniauth.rb").any?
|
52
|
+
append_file 'app/views/layouts/_navigation_links.html.erb' do <<-LINKS
|
53
|
+
<% if user_signed_in? %>
|
54
|
+
<li><%= link_to 'Logout', signout_path %></li>
|
55
|
+
<% else %>
|
56
|
+
<li><%= link_to 'Login', signin_path %></li>
|
57
|
+
<% end %>
|
47
58
|
LINKS
|
48
59
|
end
|
49
60
|
end
|
data/lib/rails_layout/version.rb
CHANGED
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.
|
4
|
+
version: 1.0.6
|
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-
|
11
|
+
date: 2014-02-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|