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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1ccb6085b59fb72a600fa3305f334b29292af235
4
- data.tar.gz: f10cd4df4604be63a6811b6504e6fff6410a2adb
3
+ metadata.gz: 1c20084ec98b6b4346b68560fffb738d81b50a9b
4
+ data.tar.gz: 9232f2d87284321e9bf234e8fdc2e9917086b5c6
5
5
  SHA512:
6
- metadata.gz: d4f464d7c213ef3c57140f5a7c1de697fb37d85b069b82c101a052579a49b41c3ed613e68f975e8135cbc0576411d1ecc06a0860d8d86af324898b05332acddf
7
- data.tar.gz: 73520aae0cf3f414f66231b8aeef99115ef5f1e924f898b5ab6be5721bcf2b32219524054a4138f7468ccc195223f574bd51c28203228303c0c9b0a0c35f4620
6
+ metadata.gz: 899524d0346f4f20f87d645abfc6e1b4dbaf61d573748c6189ed68323f4f71f98bbd0a63580b253e992cb515525b0985296e89e1b2ad53be908f757ce58aae10
7
+ data.tar.gz: c6239a188e170479dc72aa54fb479dae6e09397fc1bdcf1a6089db8d162585fe3b2c93e04aa4e4a68424f34a8ed9e1c21bef85b9f61cfc182b4b33c6cff236ff
data/CHANGELOG.textile CHANGED
@@ -1,5 +1,9 @@
1
1
  h1. CHANGELOG
2
2
 
3
+ h2. 0.1.7 October 13, 2013
4
+
5
+ * support for Haml markup
6
+
3
7
  h2. 0.1.6 October 13, 2013
4
8
 
5
9
  * support for Zurb Foundation 4.0
@@ -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
- # so far, I've only got templates for ERB, but Haml and Slim could be added
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 Haml and Slim (we'll need different substitutions)
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 <li><%= link_to 'About', page_path('about') %></li>", :before => "\n</ul>"
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 <li><%= link_to 'Contact', new_contact_path %></li>", :before => "\n</ul>"
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">&#215;</a>
5
+ <a class="close" data-dismiss="alert">&times;</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"} &times;
6
+ = content_tag :div, msg, :id => "flash_#{name}"
@@ -0,0 +1,2 @@
1
+ %ul.nav
2
+ %li= link_to 'Home', root_path
@@ -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"} &times;
6
+ = content_tag :div, msg, :id => "flash_#{name}"
@@ -0,0 +1,2 @@
1
+ %ul.nav.navbar-nav
2
+ %li= link_to 'Home', root_path
@@ -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 => "#"} &times;
@@ -0,0 +1,2 @@
1
+ %ul
2
+ %li= link_to 'Home', root_path
@@ -9,7 +9,7 @@
9
9
  <%%= csrf_meta_tags %>
10
10
  </head>
11
11
  <body>
12
- <div id="container">
12
+ <div class="container">
13
13
  <header>
14
14
  <%%= render 'layouts/navigation' %>
15
15
  </header>
@@ -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
@@ -0,0 +1,3 @@
1
+ - flash.each do |name, msg|
2
+ - if msg.is_a?(String)
3
+ = content_tag :div, msg, :id => "flash_#{name}"
@@ -0,0 +1,2 @@
1
+ %ul.nav
2
+ %li= link_to 'Home', root_path
@@ -1,3 +1,3 @@
1
1
  module RailsLayout
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
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: 0.1.6
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-13 00:00:00.000000000 Z
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