endymion-origami 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. data/README.textile +32 -30
  2. data/app/helpers/layout_helper.rb +2 -6
  3. data/app/views/layouts/1_column_pixel.html.erb +1 -70
  4. data/app/views/layouts/3_column_blog_pixel.html.erb +1 -158
  5. data/app/views/layouts/_head.html.erb +9 -3
  6. data/app/views/layouts/_javascript_includes.html.erb +1 -1
  7. data/app/views/layouts/_stylesheets.html.erb +6 -0
  8. data/lib/origami.rb +0 -9
  9. data/origami.gemspec +3 -25
  10. data/version.yml +1 -1
  11. metadata +3 -25
  12. data/app/views/layouts/_layout_and_theme_stylesheets.html.erb +0 -8
  13. data/assets/bluetrip-css-framework/LICENSE +0 -312
  14. data/assets/bluetrip-css-framework/README.rst +0 -37
  15. data/assets/bluetrip-css-framework/css/ie.css +0 -21
  16. data/assets/bluetrip-css-framework/css/print.css +0 -49
  17. data/assets/bluetrip-css-framework/css/screen.css +0 -409
  18. data/assets/bluetrip-css-framework/css/style.css +0 -7
  19. data/assets/bluetrip-css-framework/examples/grid.html +0 -232
  20. data/assets/bluetrip-css-framework/examples/index.html +0 -263
  21. data/assets/bluetrip-css-framework/examples/test-small.jpg +0 -0
  22. data/assets/bluetrip-css-framework/img/grid.png +0 -0
  23. data/assets/bluetrip-css-framework/img/icons/cross.png +0 -0
  24. data/assets/bluetrip-css-framework/img/icons/doc.png +0 -0
  25. data/assets/bluetrip-css-framework/img/icons/email.png +0 -0
  26. data/assets/bluetrip-css-framework/img/icons/external.png +0 -0
  27. data/assets/bluetrip-css-framework/img/icons/feed.png +0 -0
  28. data/assets/bluetrip-css-framework/img/icons/im.png +0 -0
  29. data/assets/bluetrip-css-framework/img/icons/information.png +0 -0
  30. data/assets/bluetrip-css-framework/img/icons/key.png +0 -0
  31. data/assets/bluetrip-css-framework/img/icons/pdf.png +0 -0
  32. data/assets/bluetrip-css-framework/img/icons/tick.png +0 -0
  33. data/assets/bluetrip-css-framework/img/icons/visited.png +0 -0
  34. data/assets/bluetrip-css-framework/img/icons/xls.png +0 -0
data/README.textile CHANGED
@@ -1,6 +1,10 @@
1
1
  h1. Origami
2
2
 
3
- A Rails Engine plugin that handles the tedious parts of setting up HTML/CSS layouts. Developing Rails apps is a very high-level pursuit, but at some point you have to code an HTML layout and styling for your web applications. That can be pretty tedious unless you have A Way. There is no One True Way to lay out a web page, any more than there is One True Way to watch a sunset. But Origami is a nice way.
3
+ There are some fantastic "CSS frameworks":http://en.wikipedia.org/wiki/CSS_framework out there, and there a growing number of tools like "Sass":http://haml.hamptoncatlin.com/docs/rdoc/classes/Sass.html and "Compass":http://haml.hamptoncatlin.com/docs/rdoc/classes/Sass.html for working with those frameworks from a high level.
4
+
5
+ However, you do not get the best results if you do your page layout purely with the grid positioning systems provided in CSS frameworks. This is because the higher up content is in your page code, the more important it is considered by search engine algorithms. To make your website as optimized as possible your main page content must come before the side columns. Origami does exactly that: The main page comes first, then supplemental columns. You can also override the layouts to place your columns in any order you like.
6
+
7
+ Origami is agnostic of CSS frameworks and it's easy to integrate with Compass and Sass, so that your layouts can easily use some of the fantastic frameworks like "Blueprint":http://www.blueprintcss.org/ that are provided by Compass.
4
8
 
5
9
  h2. The Problem
6
10
 
@@ -27,53 +31,49 @@ In your views:
27
31
  Put something here.
28
32
  <% end %>
29
33
 
30
- Origami does the rest. It wraps your page body in the necessary divs, calculates the necessary styles, and applies them using app/views/layouts/application.rb. You get validating HTML code that works in any browser and you don't have to think about HTML or CSS. You focus on your application instead.
34
+ Your mental model for laying out a page consists of the normal page body, plus in some cases things like a "column_2" section, a "header", a "footer", etc. Origami handles the implementation of those concepts for you. It wraps your page body in the necessary divs, calculates the necessary dynamic styles, and applies them. You get validating HTML code that works in any browser and you don't have to think about HTML or CSS. You focus on your application instead.
31
35
 
32
36
  h2. Features
33
37
 
34
- h3. Blueprint
35
-
36
- Sensible CSS defaults from "BlueTrip":http://bluetrip.org
37
-
38
38
  h3. Matthew James Taylor templates
39
39
 
40
40
  Origami uses HTML/CSS layouts by "Matthew James Taylor":http://matthewjamestaylor.com/ which have many features:
41
41
 
42
- h3. No CSS Hacks
42
+ h4. No CSS Hacks
43
43
 
44
44
  The CSS used for the layouts in Origami are 100% valid and hack free. To overcome Internet Explorer's broken box model, no horizontal padding or margins are used. Instead, this design uses percentage widths and clever relative positioning.
45
45
 
46
- h3. SEO friendly 2-1 column ordering
46
+ h4. SEO friendly 2-1 column ordering
47
47
 
48
- The higher up content is in your page code, the more important it is considered by search engine algorithms. To make your website as optimised as possible your main page content must come before the side columns. This layout does exactly that: The the right-hand main page comes first, then the left column (see the nested div structure diagram for more info). The columns can also be configured in the opposite order if required.
48
+ The higher up content is in your page code, the more important it is considered by search engine algorithms. To make your website as optimised as possible your main page content must come before the side columns. This layout does exactly that: The the main page comes first, then any supplemental columns. The columns can also be configured in the opposite order if required.
49
49
 
50
- h3. Full length column background colours
50
+ h4. Full length column background colours
51
51
 
52
- In this layout the background colours of each column will always stretch to the length of the longest column. This feature was traditionally only available with table based layouts but now with a little CSS trickery we can do exactly the same with divs. Say goodbye to annoying short columns!
52
+ In these layouts the background colours of each column will always stretch to the length of the longest column. This feature was traditionally only available with table based layouts but now with a little CSS trickery we can do exactly the same with divs. Say goodbye to annoying short columns!
53
53
 
54
- h3. No Images
54
+ h4. No Images
55
55
 
56
- This layout requires no images. Many CSS website designs need images to colour in the column backgrounds but that is not necessary with this design. Why waste bandwidth and precious HTTP requests when you can do everything in pure CSS and XHTML?
56
+ The layouts require no images. Many CSS website designs need images to colour in the column backgrounds but that is not necessary with this design. Why waste bandwidth and precious HTTP requests when you can do everything in pure CSS and XHTML?
57
57
 
58
- h3. No JavaScript
58
+ h4. No JavaScript
59
59
 
60
60
  JavaScript is not required. Some website layouts rely on JavaScript hacks to resize divs and force elements into place but you won't see any of that nonsense here.
61
61
 
62
- h3. Resizable text compatible
62
+ h4. Resizable text compatible
63
63
 
64
- This layout is fully compatible with resizable text. Resizable text is important for web accessibility. People who are vision impaired can make the text larger so it's easier for them to read. It is becoming increasingly more important to make your website resizable text compatible because people are expecting higher levels of web accessibility. Apple have made resizing the text on a website simple with the pinch gesture on their multi-touch trackpad. So far this trackpad is only available on the MacBook Air but it will soon be rolled out to all of their systems. Is your website text-resizing compatible?
64
+ The layouts are fully compatible with resizable text. Resizable text is important for web accessibility. People who are vision impaired can make the text larger so it's easier for them to read. It is becoming increasingly more important to make your website resizable text compatible because people are expecting higher levels of web accessibility. Apple have made resizing the text on a website simple with the pinch gesture on their multi-touch trackpad. So far this trackpad is only available on the MacBook Air but it will soon be rolled out to all of their systems. Is your website text-resizing compatible?
65
65
 
66
- h3. No Quirks Mode
66
+ h4. No Quirks Mode
67
67
 
68
- This liquid layout does not require the XML declaration for it to display correctly in older versions of Internet Explorer. This version works without it and is thus never in quirks mode.
68
+ The liquid layouts do not require the XML declarations for them to display correctly in older versions of Internet Explorer. This version works without it and is thus never in quirks mode.
69
69
 
70
- h3. No IE Conditional Comments
70
+ h4. No IE Conditional Comments
71
71
 
72
- Only one stylesheet is used with this layout This means that IE conditional comments are not needed to set extra CSS rules for older versions of Internet Explorer. This also means that ActivePackager can compress and consolidate the styles without breaking them.
72
+ Only one stylesheet is used with the layouts. This means that IE conditional comments are not needed to set extra CSS rules for older versions of Internet Explorer. This also means that ActivePackager can compress and consolidate the styles without breaking them.
73
73
 
74
- h3. Browser Compatibility
74
+ h4. Browser Compatibility
75
75
 
76
- This left menu liquid Layout has been tested on the following browsers:
76
+ The layouts have been tested on the following browsers:
77
77
 
78
78
  * iPhone & iPod Touch
79
79
  ** Safari
@@ -90,9 +90,9 @@ This left menu liquid Layout has been tested on the following browsers:
90
90
  ** Explorer 5.5, 6 & 7
91
91
  ** Netscape 8
92
92
 
93
- h3. Valid XHTML strict markup
93
+ h4. Valid XHTML strict markup
94
94
 
95
- The HTML in this layout validates as XHTML 1.0 strict.
95
+ The HTML in the layouts validates as XHTML 1.0 strict.
96
96
 
97
97
  h2. Customize
98
98
 
@@ -119,12 +119,6 @@ Origami is a Rails engine. It works with versions of Rails greater than 2.3. It
119
119
 
120
120
  h2. Install
121
121
 
122
- Do this for now:
123
-
124
- script/plugin install git://github.com/endymion/origami.git
125
-
126
- This is how I'm trying to get it to work but I'm currently having problems making Origami available as a Ruby Gem:
127
-
128
122
  In config/environment.rb:
129
123
 
130
124
  config.gem "endymion-origami",
@@ -136,3 +130,11 @@ Vendor the gem:
136
130
 
137
131
  rake gems:install
138
132
  rake gems:unpack
133
+
134
+ Note: the unpack step is required because this gem is a Rails Engine plugin.
135
+
136
+ Or, if you prefer to install it as a plugin:
137
+
138
+ script/plugin install git://github.com/endymion/origami.git
139
+
140
+
@@ -5,12 +5,8 @@ module LayoutHelper
5
5
  concat render(:partial => partial_name, :locals => options)
6
6
  end
7
7
 
8
- def layout_and_theme_stylesheets(layout, options = {}, &block)
9
- block_to_partial('layouts/layout_and_theme_stylesheets', options.merge(:layout => layout), &block)
10
- end
11
-
12
- def head(options = {}, &block)
13
- block_to_partial('layouts/head', options, &block)
8
+ def head(layout, options = {}, &block)
9
+ render(:partial => 'layouts/head', :locals => {:layout => layout})
14
10
  end
15
11
 
16
12
  def body(options = {}, &block)
@@ -1,76 +1,7 @@
1
1
  <?xml version="1.0" encoding="utf-8"?>
2
2
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
3
  <html xmlns="http://www.w3.org/1999/xhtml">
4
- <% head do %>
5
- <title>The Full Page 1 column Liquid Layout. Pixel padding widths. Cross-Browser. Equal Height Columns.</title>
6
- <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
7
- <meta name="description" content="The Full Page 1 column Liquid Layout. Pixel padding widths. Cross-Browser. Equal Height Columns." />
8
- <meta name="keywords" content="The Full Page 1 column Liquid Layout. Pixel padding widths. Cross-Browser. Equal Height Columns." />
9
- <meta name="robots" content="index, follow" />
10
- <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
11
-
12
- <% layout_and_theme_stylesheets '1_column_pixel' do %>
13
- <style media="screen" type="text/css">
14
- /* <!-- */
15
- /* General styles */
16
- body {
17
- margin:0;
18
- padding:0;
19
- border:0; /* This removes the border around the viewport in old versions of IE */
20
- width:100%;
21
- min-width:600px; /* Minimum width of layout - remove line if not required */
22
- /* The min-width property does not work in old versions of Internet Explorer */
23
- }
24
- /* Header styles */
25
- #header {
26
- clear:both;
27
- float:left;
28
- width:100%;
29
- }
30
- #header {
31
- border-bottom:1px solid #000;
32
- }
33
- #header p,
34
- #header h1,
35
- #header h2 {
36
- padding:.4em 15px 0 15px;
37
- margin:0;
38
- }
39
- /* 'widths' sub menu */
40
- #layoutdims {
41
- clear:both;
42
- border-top:4px solid #000;
43
- margin:0;
44
- padding:6px 15px !important;
45
- text-align:right;
46
- }
47
- /* column container */
48
- .colmask {
49
- position:relative; /* This fixes the IE7 overflow hidden bug and stops the layout jumping out of place */
50
- clear:both;
51
- float:left;
52
- width:100%; /* width of whole page */
53
- overflow:hidden; /* This chops off any overhanging divs */
54
- }
55
- /* 1 column full page settings */
56
- .fullpage .col1 {
57
- margin:0 15px;
58
- }
59
- /* Footer styles */
60
- #footer {
61
- clear:both;
62
- float:left;
63
- width:100%;
64
- border-top:1px solid #000;
65
- }
66
- #footer p {
67
- padding:10px;
68
- margin:0;
69
- }
70
- /* --> */
71
- </style>
72
- <% end %>
73
- <% end %>
4
+ <%= head '1_column_pixel' %>
74
5
 
75
6
  <% body do %>
76
7
 
@@ -1,164 +1,7 @@
1
1
  <?xml version="1.0" encoding="utf-8"?>
2
2
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
3
  <html xmlns="http://www.w3.org/1999/xhtml">
4
- <% head do %>
5
-
6
- <title>The Blog Style 3 column Liquid Layout. Pixel widths. Cross-Browser. Equal Height Columns.</title>
7
- <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
8
- <meta name="description" content="The Blog Style 3 column Liquid Layout. Pixel widths. Cross-Browser. Equal Height Columns." />
9
- <meta name="keywords" content="The Blog Style 3 column Liquid Layout. Pixel widths. Cross-Browser. Equal Height Columns." />
10
- <meta name="robots" content="index, follow" />
11
- <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
12
- <% end %>
13
- <% layout_and_theme_stylesheets '3_column_blog_pixel' do %>
14
- <style media="screen" type="text/css">
15
- /* <!-- */
16
- /* General styles */
17
- body {
18
- margin:0;
19
- padding:0;
20
- border:0; /* This removes the border around the viewport in old versions of IE */
21
- width:100%;
22
- background:#fff;
23
- min-width:600px; /* Minimum width of layout - remove line if not required */
24
- /* The min-width property does not work in old versions of Internet Explorer */
25
- }
26
- /* Header styles */
27
- #header {
28
- clear:both;
29
- float:left;
30
- width:100%;
31
- }
32
- #header {
33
- border-bottom:1px solid #000;
34
- }
35
- #header p,
36
- #header h1,
37
- #header h2 {
38
- padding:.4em 15px 0 15px;
39
- margin:0;
40
- }
41
- #header ul {
42
- clear:left;
43
- float:left;
44
- width:100%;
45
- list-style:none;
46
- margin:10px 0 0 0;
47
- padding:0;
48
- }
49
- #header ul li {
50
- display:inline;
51
- list-style:none;
52
- margin:0;
53
- padding:0;
54
- }
55
- #header ul li a {
56
- display:block;
57
- float:left;
58
- margin:0 0 0 1px;
59
- padding:3px 10px;
60
- text-align:center;
61
- background:#eee;
62
- color:#000;
63
- text-decoration:none;
64
- position:relative;
65
- left:15px;
66
- line-height:1.3em;
67
- }
68
- #header ul li a:hover {
69
- background:#369;
70
- color:#fff;
71
- }
72
- #header ul li a.active,
73
- #header ul li a.active:hover {
74
- color:#fff;
75
- background:#000;
76
- font-weight:bold;
77
- }
78
- #header ul li a span {
79
- display:block;
80
- }
81
- /* 'widths' sub menu */
82
- #layoutdims {
83
- clear:both;
84
- background:#eee;
85
- border-top:4px solid #000;
86
- margin:0;
87
- padding:6px 15px !important;
88
- text-align:right;
89
- }
90
- /* column container */
91
- .colmask {
92
- position:relative; /* This fixes the IE7 overflow hidden bug and stops the layout jumping out of place */
93
- clear:both;
94
- float:left;
95
- width:100%; /* width of whole page */
96
- overflow:hidden; /* This chops off any overhanging divs */
97
- }
98
- /* 3 column blog style settings */
99
- .blogstyle {
100
- background:#ff9; /* Right column background colour */
101
- }
102
- .blogstyle .colmid {
103
- float:left;
104
- width:200%;
105
- margin-left:-200px; /* Width of right column */
106
- position:relative;
107
- right:100%;
108
- background:#FFD8B7; /* Centre column background colour */
109
- }
110
- .blogstyle .colleft {
111
- float:left;
112
- width:100%;
113
- margin-left:-200px; /* Width of centre column */
114
- background:#fff; /* Left column background colour */
115
- }
116
- .blogstyle .col1wrap {
117
- float:left;
118
- width:50%;
119
- padding-bottom:1em; /* Centre column bottom padding. Leave it out if it's zero */
120
- }
121
- .blogstyle .col1 {
122
- margin:0 15px 0 415px; /* Centre column side padding:
123
- Left padding = left column width + centre column left padding width
124
- Right padding = right column width + centre column right padding width */
125
- position:relative;
126
- left:100%;
127
- overflow:hidden;
128
- }
129
- .blogstyle .col2 {
130
- float:right;
131
- width:170px; /* Width of left column content (left column width minus left and right padding) */
132
- position:relative;
133
- left:185px; /* Width of the left-had side padding on the left column */
134
- }
135
- .blogstyle .col3 {
136
- float:right;
137
- width:170px; /* Width of right column content (right column width minus left and right padding) */
138
- position:relative;
139
- left:555px;
140
- }
141
- /* Footer styles */
142
- #footer {
143
- clear:both;
144
- float:left;
145
- width:100%;
146
- border-top:1px solid #000;
147
- }
148
- #footer p {
149
- padding:10px;
150
- margin:0;
151
- }
152
- /* --> */
153
- </style>
154
- <!--[if lt IE 7]>
155
- <style media="screen" type="text/css">
156
- .col1 {
157
- width:100%;
158
- }
159
- </style>
160
- <![endif]-->
161
- <% end %>
4
+ <%= head '3_column_blog_pixel' %>
162
5
 
163
6
  <% body do %>
164
7
 
@@ -15,9 +15,15 @@
15
15
  <% end -%>
16
16
  <meta name="robots" content="index, follow" />
17
17
 
18
- <%= stylesheet_link_tag 'screen', :media => 'screen, projection' %>
19
- <%= stylesheet_link_tag 'style', :media => 'screen, projection' %>
20
- <%= stylesheet_link_tag 'print', :media => 'print' %>
18
+ <%= render :partial => 'layouts/stylesheets', :locals => { :layout => layout } %>
19
+ <% theme = THEME if defined?(THEME)
20
+ theme = @theme unless @theme.nil?
21
+ if theme.nil? -%>
22
+ <% else -%>
23
+ <%= stylesheet_link_tag "layouts/#{layout}" %>
24
+ <%= stylesheet_link_tag theme %>
25
+ <% end -%>
21
26
 
22
27
  <%= render :partial => 'layouts/javascript_includes' %>
28
+
23
29
  </head>
@@ -1 +1 @@
1
- <%= javascript_include_tag :defaults %>
1
+ <%= javascript_include_tag :defaults %>
@@ -0,0 +1,6 @@
1
+ <% if defined?(BLUEPRINT) -%>
2
+ <%= stylesheet_link_tag 'compiled/screen', :media => 'screen, projection' %>
3
+ <%= stylesheet_link_tag 'compiled/style', :media => 'screen, projection' %>
4
+ <%= stylesheet_link_tag 'compiled/print', :media => 'print' %>
5
+ <!--[if IE]><%= stylesheet_link_tag 'compiled/ie', :media => 'screen, projection' %><![endif]-->
6
+ <% end -%>
data/lib/origami.rb CHANGED
@@ -1,9 +0,0 @@
1
- class ApplicationController < ActionController::Base
2
-
3
- # Override render so that it will look for a layout setting.
4
- def render(options = {}, extra_options = {}, &block)
5
- options.merge!(:layout => @layout) unless @layout.nil?
6
- super(options, extra_options, &block)
7
- end
8
-
9
- end
data/origami.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{origami}
5
- s.version = "0.1.3"
5
+ s.version = "0.1.4"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Ryan Porter", "Matthew James Taylor"]
9
- s.date = %q{2009-05-18}
9
+ s.date = %q{2009-05-19}
10
10
  s.description = %q{Origami is a Rails Engine plugin that handles the tedious parts of setting up HTML/CSS layoutspec.}
11
11
  s.email = %q{rap@endymion.com}
12
12
  s.extra_rdoc_files = [
@@ -43,30 +43,8 @@ Gem::Specification.new do |s|
43
43
  "app/views/layouts/_header.html.erb",
44
44
  "app/views/layouts/_image_replacement.html.erb",
45
45
  "app/views/layouts/_javascript_includes.html.erb",
46
- "app/views/layouts/_layout_and_theme_stylesheets.html.erb",
46
+ "app/views/layouts/_stylesheets.html.erb",
47
47
  "app/views/layouts/stacked_columns.html.erb",
48
- "assets/bluetrip-css-framework/LICENSE",
49
- "assets/bluetrip-css-framework/README.rst",
50
- "assets/bluetrip-css-framework/css/ie.css",
51
- "assets/bluetrip-css-framework/css/print.css",
52
- "assets/bluetrip-css-framework/css/screen.css",
53
- "assets/bluetrip-css-framework/css/style.css",
54
- "assets/bluetrip-css-framework/examples/grid.html",
55
- "assets/bluetrip-css-framework/examples/index.html",
56
- "assets/bluetrip-css-framework/examples/test-small.jpg",
57
- "assets/bluetrip-css-framework/img/grid.png",
58
- "assets/bluetrip-css-framework/img/icons/cross.png",
59
- "assets/bluetrip-css-framework/img/icons/doc.png",
60
- "assets/bluetrip-css-framework/img/icons/email.png",
61
- "assets/bluetrip-css-framework/img/icons/external.png",
62
- "assets/bluetrip-css-framework/img/icons/feed.png",
63
- "assets/bluetrip-css-framework/img/icons/im.png",
64
- "assets/bluetrip-css-framework/img/icons/information.png",
65
- "assets/bluetrip-css-framework/img/icons/key.png",
66
- "assets/bluetrip-css-framework/img/icons/pdf.png",
67
- "assets/bluetrip-css-framework/img/icons/tick.png",
68
- "assets/bluetrip-css-framework/img/icons/visited.png",
69
- "assets/bluetrip-css-framework/img/icons/xls.png",
70
48
  "init.rb",
71
49
  "install.rb",
72
50
  "lib/origami.rb",