rails_layout 0.4.2 → 0.5.0

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: a8f286b5dede0a34301197d091a859c29b66b03e
4
- data.tar.gz: 9d15042b9879a3e6d56bd4b50c1e970309ae28cc
3
+ metadata.gz: 013fe55249e20e74336135399feb15ea57f8e1c7
4
+ data.tar.gz: b0ca5c2409d5545430624e4f88306af221d91e8f
5
5
  SHA512:
6
- metadata.gz: 9ea309f056b0d64ca8994fcbef4644e2d86a8ca3b6d5319e56590860b3d36e9d51945957bc3896d81c7e38431f18a695402eb0710f1a23b615197dd8a5e321c1
7
- data.tar.gz: 1bb1235d2c9f07941fed0df0869f2dae0609137d5b1b3756126c3d2296eb9165251781cfb606669a0e293517b076e5267a107da62bff329f85fc921e21cbca36
6
+ metadata.gz: 334535fb11d3220fcf229a68e867eecbbd3aa1aacfa4d2272973ff8266ac985c6672c1635441c405e5e969ea6385b167f7da64850cea2e70a6f041c4df27564a
7
+ data.tar.gz: c9fd68db7d1d2a80d1306af25da226d6262ad4ee5ed57f286f510de8b63f21facdf4a0409c2becd816282b4cb2edc0b529d692233805f4227c59565d7bf891f8
data/CHANGELOG.textile CHANGED
@@ -1,5 +1,9 @@
1
1
  h1. CHANGELOG
2
2
 
3
+ h3. 0.5.0 November 11, 2013
4
+
5
+ * use mixins for uniform layout across frameworks
6
+
3
7
  h3. 0.4.2 November 9, 2013
4
8
 
5
9
  * move 'Home' link to conform to framework examples
data/README.textile CHANGED
@@ -185,7 +185,7 @@ See the files that are generated:
185
185
 
186
186
  The RailsLayout gem will create the file:
187
187
 
188
- * "app/assets/stylesheets/bootstrap_and_overrides.css.scss":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/templates/bootstrap2_and_overrides.css.scss
188
+ * "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
189
189
 
190
190
  and modify the file:
191
191
 
@@ -213,7 +213,7 @@ See the files that are generated:
213
213
 
214
214
  The RailsLayout gem will create the file:
215
215
 
216
- * "app/assets/stylesheets/bootstrap_and_overrides.css.scss":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/templates/bootstrap3_and_overrides.css.scss
216
+ * "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
217
217
 
218
218
  and modify the file:
219
219
 
@@ -1,20 +1,35 @@
1
1
  Description:
2
2
  Creates Rails layout files suitable for various front-end frameworks.
3
3
 
4
+ Create simple layout files when no front-end framework is used:
5
+ rails generate layout simple
6
+
7
+ Create layout files suitable for Twitter Bootstrap 2.3:
8
+ rails generate layout bootstrap2
9
+
10
+ Create layout files suitable for Twitter Bootstrap 3.0:
11
+ rails generate layout bootstrap3
12
+
13
+ Create layout files suitable for Zurb Foundation 4.0:
14
+ rails generate layout foundation4
15
+
16
+ Remove layout files:
17
+ rails generate layout none
18
+
4
19
  Creates files:
5
20
  * app/views/layouts/application.html.erb
6
21
  * app/views/layouts/_messages.html.erb
7
22
  * app/views/layouts/_navigation.html.erb
23
+ * app/views/layouts/_navigation_links.html.erb
8
24
  * app/assets/stylesheets/simple.css (only for simple option)
9
25
 
10
- Create simple layout files when no front-end framework is used:
11
- rails generate layout simple
12
-
13
- Create layout files suitable for Twitter Bootstrap 2.3:
14
- rails generate layout bootstrap2
26
+ Renames the file:
27
+ * app/assets/stylesheets/application.css
28
+ to:
29
+ * app/assets/stylesheets/application.css.scss
15
30
 
16
- Create layout files suitable for Twitter Bootstrap 3.0:
17
- rails generate layout bootstrap3
31
+ Modifies the file:
32
+ * app/assets/javascripts/application.js
18
33
 
19
- Create layout files suitable for Zurb Foundation 4.0:
20
- rails generate layout foundation4
34
+ Adds the file:
35
+ * app/assets/stylesheets/framework_and_overrides.css.scss
@@ -11,14 +11,3 @@
11
11
  *= require_self
12
12
  *= require_tree .
13
13
  */
14
- .content {
15
- background-color: #eee;
16
- padding: 20px;
17
- margin: 0 -20px;
18
- -webkit-border-radius: 0 0 6px 6px;
19
- -moz-border-radius: 0 0 6px 6px;
20
- border-radius: 0 0 6px 6px;
21
- -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.15);
22
- -moz-box-shadow: 0 1px 2px rgba(0,0,0,.15);
23
- box-shadow: 0 1px 2px rgba(0,0,0,.15);
24
- }
@@ -9,19 +9,12 @@
9
9
  <%%= csrf_meta_tags %>
10
10
  </head>
11
11
  <body>
12
- <%%# application layout styled for Twitter Bootstrap 3.0 %>
13
12
  <header>
14
13
  <%%= render 'layouts/navigation' %>
15
14
  </header>
16
15
  <main role="main">
17
- <div class="container">
18
- <div class="row">
19
- <div class="col-md-12">
20
- <%%= render 'layouts/messages' %>
21
- <%%= yield %>
22
- </div>
23
- </div>
24
- </div>
16
+ <%%= render 'layouts/messages' %>
17
+ <%%= yield %>
25
18
  </main>
26
19
  </body>
27
20
  </html>
@@ -8,15 +8,8 @@
8
8
  = javascript_include_tag "application", "data-turbolinks-track" => true
9
9
  = csrf_meta_tags
10
10
  %body
11
- -# application layout styled for Twitter Bootstrap 3.0
12
11
  %header
13
12
  = render 'layouts/navigation'
14
13
  %main{:role => "main"}
15
- .container
16
- .container
17
- .content
18
- .row
19
- .col-md-12
20
- = render 'layouts/messages'
21
- = yield
22
- %footer
14
+ = render 'layouts/messages'
15
+ = yield
@@ -1,5 +1,5 @@
1
1
  <%# navigation styled for Twitter Bootstrap 3.0 %>
2
- <nav class="navbar navbar-default navbar-fixed-top">
2
+ <nav class="navbar navbar-inverse navbar-fixed-top">
3
3
  <div class="container">
4
4
  <div class="navbar-header">
5
5
  <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
@@ -3,4 +3,39 @@
3
3
 
4
4
  // override for the 'Home' navigation link
5
5
  .navbar-brand {
6
- font-size: inherit; }
6
+ font-size: inherit;
7
+ }
8
+ // make all images responsive by default
9
+ img {
10
+ @extend .img-responsive;
11
+ margin: 0 auto;
12
+ }
13
+
14
+ // use mixins to create semantic classes
15
+ main {
16
+ @extend .container;
17
+ background-color: #eee;
18
+ padding-bottom: 80px;
19
+ width: 100%;
20
+ margin-top: 51px; // accommodate the navbar
21
+ }
22
+ section {
23
+ @extend .row;
24
+ margin-top: 20px;
25
+ }
26
+ .column {
27
+ @extend .col-md-6;
28
+ @extend .text-center;
29
+ }
30
+ .form {
31
+ @extend .col-md-6;
32
+ }
33
+ .form-centered {
34
+ @extend .col-md-6;
35
+ @extend .text-center;
36
+ }
37
+ .submit {
38
+ @extend .btn;
39
+ @extend .btn-primary;
40
+ @extend .btn-lg;
41
+ }
@@ -11,23 +11,12 @@
11
11
  <%%= csrf_meta_tags %>
12
12
  </head>
13
13
  <body>
14
- <%%# application layout styled for Zurb Foundation 4 %>
15
14
  <header>
16
15
  <%%= render 'layouts/navigation' %>
17
16
  </header>
18
17
  <main role="main">
19
- <div class="container">
20
- <div class="content">
21
- <div class="row">
22
- <div class="twelve columns">
23
- <%%= render 'layouts/messages' %>
24
- <%%= yield %>
25
- </div>
26
- </div>
27
- <footer>
28
- </footer>
29
- </div>
30
- </div>
18
+ <%%= render 'layouts/messages' %>
19
+ <%%= yield %>
31
20
  </main>
32
21
  </body>
33
22
  </html>
@@ -10,14 +10,8 @@
10
10
  = javascript_include_tag "application", "data-turbolinks-track" => true
11
11
  = csrf_meta_tags
12
12
  %body
13
- -# application layout styled for Zurb Foundation 4
14
13
  %header
15
14
  = render 'layouts/navigation'
16
15
  %main{:role => "main"}
17
- .container
18
- .content
19
- .row
20
- .twelve.columns
21
- = render 'layouts/messages'
22
- = yield
23
- %footer
16
+ = render 'layouts/messages'
17
+ = yield
@@ -4,9 +4,9 @@
4
4
  <li class="name"><%= link_to 'Home', root_path %></li>
5
5
  <li class="toggle-topbar menu-icon"><a href="#"><span>Menu</span></a></li>
6
6
  </ul>
7
- <section class="top-bar-section">
7
+ <div class="top-bar-section">
8
8
  <ul>
9
9
  <%= render 'layouts/navigation_links' %>
10
10
  </ul>
11
- </section>
11
+ </div>
12
12
  </nav>
@@ -6,6 +6,6 @@
6
6
  %li.toggle-topbar.menu-icon
7
7
  %a{:href => "#"}
8
8
  %span Menu
9
- %section.top-bar-section
9
+ .top-bar-section
10
10
  %ul
11
11
  = render 'layouts/navigation_links'
@@ -9,3 +9,35 @@
9
9
  font-weight: bold;
10
10
  color: white;
11
11
  padding: 0 15px; }
12
+
13
+ // use mixins to create semantic classes
14
+ @mixin large12-columns {
15
+ @extend .large-12;
16
+ @extend .columns;
17
+ }
18
+ @mixin large6-columns-centered {
19
+ @extend .large-6;
20
+ @extend .columns;
21
+ @extend .text-center;
22
+ }
23
+ main {
24
+ @include large12-columns;
25
+ background-color: #eee;
26
+ }
27
+ section {
28
+ @extend .row;
29
+ margin-top: 20px;
30
+ }
31
+ .column {
32
+ @include large6-columns-centered;
33
+ }
34
+ .form {
35
+ @include grid-column(6);
36
+ }
37
+ .form-centered {
38
+ @include large6-columns-centered;
39
+ }
40
+ .submit {
41
+ @extend .button;
42
+ @extend .radius;
43
+ }
@@ -9,18 +9,12 @@
9
9
  <%%= csrf_meta_tags %>
10
10
  </head>
11
11
  <body>
12
- <div class="container">
13
- <header>
14
- <%%= render 'layouts/navigation' %>
15
- </header>
16
- <main role="main">
17
- <div class="content">
18
- <%%= render 'layouts/messages' %>
19
- <%%= yield %>
20
- </div>
21
- </main>
22
- <footer>
23
- </footer>
24
- </div>
12
+ <header>
13
+ <%%= render 'layouts/navigation' %>
14
+ </header>
15
+ <main role="main">
16
+ <%%= render 'layouts/messages' %>
17
+ <%%= yield %>
18
+ </main>
25
19
  </body>
26
20
  </html>
@@ -8,11 +8,8 @@
8
8
  = javascript_include_tag "application", "data-turbolinks-track" => true
9
9
  = csrf_meta_tags
10
10
  %body
11
- .container
12
- %header
13
- = render 'layouts/navigation'
14
- %main{:role => "main"}
15
- .content
16
- = render 'layouts/messages'
17
- = yield
18
- %footer
11
+ %header
12
+ = render 'layouts/navigation'
13
+ %main{:role => "main"}
14
+ = render 'layouts/messages'
15
+ = yield
@@ -1,3 +1,4 @@
1
1
  <ul class="nav">
2
+ <li><%= link_to 'Home', root_path %></li>
2
3
  <%= render 'layouts/navigation_links' %>
3
4
  </ul>
@@ -1,2 +1,3 @@
1
1
  %ul.nav
2
+ %li= link_to 'Home', root_path
2
3
  = render 'layouts/navigation_links'
@@ -1,6 +1,11 @@
1
1
  /*
2
2
  * Simple CSS stylesheet for a navigation bar and flash messages.
3
3
  */
4
+ main {
5
+ background-color: #eee;
6
+ padding-bottom: 80px;
7
+ width: 100%;
8
+ }
4
9
  header {
5
10
  border: 1px solid #d4d4d4;
6
11
  background-image: linear-gradient(to bottom, white, #f2f2f2);
@@ -1,3 +1,3 @@
1
1
  module RailsLayout
2
- VERSION = "0.4.2"
2
+ VERSION = "0.5.0"
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.4.2
4
+ version: 0.5.0
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-11-10 00:00:00.000000000 Z
11
+ date: 2013-11-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler