rails_layout 0.1.6 → 0.1.7
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/lib/generators/layout/USAGE +6 -0
- data/lib/generators/layout/layout_generator.rb +10 -4
- data/lib/generators/layout/templates/bootstrap2-application.html.haml +23 -0
- data/lib/generators/layout/templates/bootstrap2-messages.html.erb +1 -1
- data/lib/generators/layout/templates/bootstrap2-messages.html.haml +6 -0
- data/lib/generators/layout/templates/bootstrap2-navigation.html.haml +2 -0
- data/lib/generators/layout/templates/bootstrap3-application.html.haml +31 -0
- data/lib/generators/layout/templates/bootstrap3-messages.html.haml +6 -0
- data/lib/generators/layout/templates/bootstrap3-navigation.html.haml +2 -0
- data/lib/generators/layout/templates/foundation4-application.html.haml +31 -0
- data/lib/generators/layout/templates/foundation4-messages.html.haml +6 -0
- data/lib/generators/layout/templates/foundation4-navigation.html.haml +2 -0
- data/lib/generators/layout/templates/simple-application.html.erb +1 -1
- data/lib/generators/layout/templates/simple-application.html.haml +17 -0
- data/lib/generators/layout/templates/simple-messages.html.haml +3 -0
- data/lib/generators/layout/templates/simple-navigation.html.haml +2 -0
- data/lib/rails_layout/version.rb +1 -1
- metadata +14 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c20084ec98b6b4346b68560fffb738d81b50a9b
|
4
|
+
data.tar.gz: 9232f2d87284321e9bf234e8fdc2e9917086b5c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 899524d0346f4f20f87d645abfc6e1b4dbaf61d573748c6189ed68323f4f71f98bbd0a63580b253e992cb515525b0985296e89e1b2ad53be908f757ce58aae10
|
7
|
+
data.tar.gz: c6239a188e170479dc72aa54fb479dae6e09397fc1bdcf1a6089db8d162585fe3b2c93e04aa4e4a68424f34a8ed9e1c21bef85b9f61cfc182b4b33c6cff236ff
|
data/CHANGELOG.textile
CHANGED
data/lib/generators/layout/USAGE
CHANGED
@@ -12,3 +12,9 @@ Create simple layout files when no front-end framework is used:
|
|
12
12
|
|
13
13
|
Create layout files suitable for Twitter Bootstrap 2.3:
|
14
14
|
rails generate layout bootstrap2
|
15
|
+
|
16
|
+
Create layout files suitable for Twitter Bootstrap 3.0:
|
17
|
+
rails generate layout bootstrap3
|
18
|
+
|
19
|
+
Create layout files suitable for Zurb Foundation 4.0:
|
20
|
+
rails generate layout foundation4
|
@@ -13,7 +13,7 @@ module Layout
|
|
13
13
|
app = ::Rails.application
|
14
14
|
@app_name = app.class.to_s.split("::").first
|
15
15
|
ext = app.config.generators.options[:rails][:template_engine] || :erb
|
16
|
-
#
|
16
|
+
# I've got templates for ERB and Haml (but not Slim)
|
17
17
|
template "#{framework_name}-application.html.#{ext}", "app/views/layouts/application.html.#{ext}"
|
18
18
|
copy_file "#{framework_name}-messages.html.#{ext}", "app/views/layouts/_messages.html.#{ext}"
|
19
19
|
copy_file "#{framework_name}-navigation.html.#{ext}", "app/views/layouts/_navigation.html.#{ext}"
|
@@ -30,12 +30,18 @@ module Layout
|
|
30
30
|
|
31
31
|
# If 'About' or 'Contact' views exist in known locations, add navigation links
|
32
32
|
def add_navigation_links
|
33
|
-
# not yet accommodating
|
33
|
+
# not yet accommodating Slim (we'll need different substitutions)
|
34
34
|
if File.exists?('app/views/pages/about.html.erb')
|
35
|
-
insert_into_file 'app/views/layouts/_navigation.html.erb', "\n
|
35
|
+
insert_into_file 'app/views/layouts/_navigation.html.erb', "\n %li= link_to 'About', page_path('about') %></li>", :before => "\n</ul>"
|
36
36
|
end
|
37
37
|
if File.exists?('app/views/contacts/new.html.erb')
|
38
|
-
insert_into_file 'app/views/layouts/_navigation.html.erb', "\n
|
38
|
+
insert_into_file 'app/views/layouts/_navigation.html.erb', "\n %li= link_to 'Contact', new_contact_path %></li>", :before => "\n</ul>"
|
39
|
+
end
|
40
|
+
if File.exists?('app/views/contacts/new.html.haml')
|
41
|
+
insert_into_file 'app/views/layouts/_navigation.html.haml', "\n %li= link_to 'Contact', new_contact_path", :after => "root_path"
|
42
|
+
end
|
43
|
+
if File.exists?('app/views/pages/about.html.haml')
|
44
|
+
insert_into_file 'app/views/layouts/_navigation.html.haml', "\n %li= link_to 'About', page_path('about')", :after => "root_path"
|
39
45
|
end
|
40
46
|
end
|
41
47
|
|
@@ -0,0 +1,23 @@
|
|
1
|
+
!!!
|
2
|
+
%html
|
3
|
+
%head
|
4
|
+
%meta{:name => "viewport", :content => "width=device-width, initial-scale=1.0"}
|
5
|
+
%title= content_for?(:title) ? yield(:title) : '<%= app_name.underscore.titleize %>'
|
6
|
+
%meta{:name => "description", :content => "#{content_for?(:description) ? yield(:description) : '<%= app_name.underscore.titleize %>'}"}
|
7
|
+
= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true
|
8
|
+
= javascript_include_tag "application", "data-turbolinks-track" => true
|
9
|
+
= csrf_meta_tags
|
10
|
+
%body
|
11
|
+
-# application layout styled for Twitter Bootstrap 2.3
|
12
|
+
%header.navbar.navbar-fixed-top
|
13
|
+
%nav.navbar-inner
|
14
|
+
.container
|
15
|
+
= render 'layouts/navigation'
|
16
|
+
%main{:role => "main"}
|
17
|
+
.container
|
18
|
+
.content
|
19
|
+
.row
|
20
|
+
.span12
|
21
|
+
= render 'layouts/messages'
|
22
|
+
= yield
|
23
|
+
%footer
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<% flash.each do |name, msg| %>
|
3
3
|
<% if msg.is_a?(String) %>
|
4
4
|
<div class="alert alert-<%= name == :notice ? "success" : "error" %>">
|
5
|
-
<a class="close" data-dismiss="alert"
|
5
|
+
<a class="close" data-dismiss="alert">×</a>
|
6
6
|
<%= content_tag :div, msg, :id => "flash_#{name}" %>
|
7
7
|
</div>
|
8
8
|
<% end %>
|
@@ -0,0 +1,6 @@
|
|
1
|
+
-# Rails flash messages styled for Twitter Bootstrap 2.3
|
2
|
+
- flash.each do |name, msg|
|
3
|
+
- if msg.is_a?(String)
|
4
|
+
%div{:class => "alert alert-#{name == :notice ? "success" : "error"}"}
|
5
|
+
%a.close{"data-dismiss" => "alert"} ×
|
6
|
+
= content_tag :div, msg, :id => "flash_#{name}"
|
@@ -0,0 +1,31 @@
|
|
1
|
+
!!!
|
2
|
+
%html
|
3
|
+
%head
|
4
|
+
%meta{:name => "viewport", :content => "width=device-width, initial-scale=1.0"}
|
5
|
+
%title= content_for?(:title) ? yield(:title) : '<%= app_name.underscore.titleize %>'
|
6
|
+
%meta{:name => "description", :content => "#{content_for?(:description) ? yield(:description) : '<%= app_name.underscore.titleize %>'}"}
|
7
|
+
= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true
|
8
|
+
= javascript_include_tag "application", "data-turbolinks-track" => true
|
9
|
+
= csrf_meta_tags
|
10
|
+
%body
|
11
|
+
-# application layout styled for Twitter Bootstrap 3.0
|
12
|
+
%header
|
13
|
+
%nav.navbar.navbar-default.navbar-fixed-top
|
14
|
+
.container
|
15
|
+
.navbar-header
|
16
|
+
%button.navbar-toggle{"data-target" => ".navbar-collapse", "data-toggle" => "collapse", :type => "button"}
|
17
|
+
%span.sr-only Toggle navigation
|
18
|
+
%span.icon-bar
|
19
|
+
%span.icon-bar
|
20
|
+
%span.icon-bar
|
21
|
+
.collapse.navbar-collapse
|
22
|
+
= render 'layouts/navigation'
|
23
|
+
%main{:role => "main"}
|
24
|
+
.container
|
25
|
+
.container
|
26
|
+
.content
|
27
|
+
.row
|
28
|
+
.col-md-12
|
29
|
+
= render 'layouts/messages'
|
30
|
+
= yield
|
31
|
+
%footer
|
@@ -0,0 +1,6 @@
|
|
1
|
+
-# Rails flash messages styled for Twitter Bootstrap 3.0
|
2
|
+
- flash.each do |name, msg|
|
3
|
+
- if msg.is_a?(String)
|
4
|
+
%div{:class => "alert alert-#{name == :notice ? "success" : "danger"}"}
|
5
|
+
%button.close{"aria-hidden" => "true", "data-dismiss" => "alert", :type => "button"} ×
|
6
|
+
= content_tag :div, msg, :id => "flash_#{name}"
|
@@ -0,0 +1,31 @@
|
|
1
|
+
!!!
|
2
|
+
%html
|
3
|
+
%head
|
4
|
+
%meta{:name => "viewport", :content => "width=device-width, initial-scale=1.0"}
|
5
|
+
%title= content_for?(:title) ? yield(:title) : '<%= app_name.underscore.titleize %>'
|
6
|
+
%meta{:name => "description", :content => "#{content_for?(:description) ? yield(:description) : '<%= app_name.underscore.titleize %>'}"}
|
7
|
+
= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true
|
8
|
+
-# Modernizr is required for Zurb Foundation 4
|
9
|
+
= javascript_include_tag "vendor/custom.modernizr"
|
10
|
+
= javascript_include_tag "application", "data-turbolinks-track" => true
|
11
|
+
= csrf_meta_tags
|
12
|
+
%body
|
13
|
+
-# application layout styled for Zurb Foundation 4
|
14
|
+
%header
|
15
|
+
%nav.top-bar
|
16
|
+
%ul.title-area
|
17
|
+
%li.name
|
18
|
+
-# add site name or logo here
|
19
|
+
%li.toggle-topbar.menu-icon
|
20
|
+
%a{:href => "#"}
|
21
|
+
%span Menu
|
22
|
+
%section.top-bar-section
|
23
|
+
= render 'layouts/navigation'
|
24
|
+
%main{:role => "main"}
|
25
|
+
.container
|
26
|
+
.content
|
27
|
+
.row
|
28
|
+
.twelve.columns
|
29
|
+
= render 'layouts/messages'
|
30
|
+
= yield
|
31
|
+
%footer
|
@@ -0,0 +1,6 @@
|
|
1
|
+
-# Rails flash messages styled for Zurb Foundation 4
|
2
|
+
- flash.each do |name, msg|
|
3
|
+
- if msg.is_a?(String)
|
4
|
+
%div{:class => "alert-box #{name == :notice ? "warning" : "alert"}", "data-alert" => ""}
|
5
|
+
= content_tag :div, msg, :id => "flash_#{name}"
|
6
|
+
%a.close{:href => "#"} ×
|
@@ -0,0 +1,17 @@
|
|
1
|
+
!!!
|
2
|
+
%html
|
3
|
+
%head
|
4
|
+
%meta{:name => "viewport", :content => "width=device-width, initial-scale=1.0"}
|
5
|
+
%title= content_for?(:title) ? yield(:title) : '<%= app_name.underscore.titleize %>'
|
6
|
+
%meta{:name => "description", :content => "#{content_for?(:description) ? yield(:description) : '<%= app_name.underscore.titleize %>'}"}
|
7
|
+
= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true
|
8
|
+
= javascript_include_tag "application", "data-turbolinks-track" => true
|
9
|
+
= csrf_meta_tags
|
10
|
+
%body
|
11
|
+
.container
|
12
|
+
%header
|
13
|
+
= render 'layouts/navigation'
|
14
|
+
%main{:role => "main"}
|
15
|
+
= render 'layouts/messages'
|
16
|
+
= yield
|
17
|
+
%footer
|
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: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Kehoe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-10-
|
11
|
+
date: 2013-10-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -55,17 +55,29 @@ files:
|
|
55
55
|
- lib/generators/layout/USAGE
|
56
56
|
- lib/generators/layout/layout_generator.rb
|
57
57
|
- lib/generators/layout/templates/bootstrap2-application.html.erb
|
58
|
+
- lib/generators/layout/templates/bootstrap2-application.html.haml
|
58
59
|
- lib/generators/layout/templates/bootstrap2-messages.html.erb
|
60
|
+
- lib/generators/layout/templates/bootstrap2-messages.html.haml
|
59
61
|
- lib/generators/layout/templates/bootstrap2-navigation.html.erb
|
62
|
+
- lib/generators/layout/templates/bootstrap2-navigation.html.haml
|
60
63
|
- lib/generators/layout/templates/bootstrap3-application.html.erb
|
64
|
+
- lib/generators/layout/templates/bootstrap3-application.html.haml
|
61
65
|
- lib/generators/layout/templates/bootstrap3-messages.html.erb
|
66
|
+
- lib/generators/layout/templates/bootstrap3-messages.html.haml
|
62
67
|
- lib/generators/layout/templates/bootstrap3-navigation.html.erb
|
68
|
+
- lib/generators/layout/templates/bootstrap3-navigation.html.haml
|
63
69
|
- lib/generators/layout/templates/foundation4-application.html.erb
|
70
|
+
- lib/generators/layout/templates/foundation4-application.html.haml
|
64
71
|
- lib/generators/layout/templates/foundation4-messages.html.erb
|
72
|
+
- lib/generators/layout/templates/foundation4-messages.html.haml
|
65
73
|
- lib/generators/layout/templates/foundation4-navigation.html.erb
|
74
|
+
- lib/generators/layout/templates/foundation4-navigation.html.haml
|
66
75
|
- lib/generators/layout/templates/simple-application.html.erb
|
76
|
+
- lib/generators/layout/templates/simple-application.html.haml
|
67
77
|
- lib/generators/layout/templates/simple-messages.html.erb
|
78
|
+
- lib/generators/layout/templates/simple-messages.html.haml
|
68
79
|
- lib/generators/layout/templates/simple-navigation.html.erb
|
80
|
+
- lib/generators/layout/templates/simple-navigation.html.haml
|
69
81
|
- lib/generators/layout/templates/simple.css
|
70
82
|
- lib/rails_layout.rb
|
71
83
|
- lib/rails_layout/version.rb
|