custom_layout 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,6 @@
1
1
  class CustomLayoutGenerator < Rails::Generators::Base
2
2
  source_root File.expand_path('../templates', __FILE__)
3
3
  argument :theme, :type => :string, :default => "black_mamba"
4
-
5
4
 
6
5
  def remove_existing_layout
7
6
  remove_file 'app/views/layouts/application.html.erb'
@@ -15,6 +14,22 @@ class CustomLayoutGenerator < Rails::Generators::Base
15
14
  copy_file "#{theme}/print.css", "app/assets/stylesheets/print.css"
16
15
  copy_file "#{theme}/application.css", "app/assets/stylesheets/application.css"
17
16
  copy_file "#{theme}/layout.css.scss", "app/assets/stylesheets/layout.css.scss"
17
+ copy_file "#{theme}/button.css.scss", "app/assets/stylesheets/button.css.scss"
18
+ copy_file "#{theme}/modernizr-1.7.min.js", "app/assets/javascripts/modernizr-1.7.min.js"
18
19
  template "#{theme}/bg.gif", "app/assets/images/bg.gif"
19
20
  end
21
+
22
+ # 1. get the scaffold name
23
+ # 2. loop over each view
24
+ # 2.1. replace h1 => h3
25
+ # 2.2 create subcol
26
+ #<% content_for :subcol do %>
27
+ # <div class="notice">
28
+ # <h4>Information</h4>
29
+ # <p><%= link_to 'Back', searches_path %></p>
30
+ #<% end %>
31
+ # 2.3 delete <br />
32
+
33
+
34
+
20
35
  end
@@ -0,0 +1,60 @@
1
+ a.button, button, input[type="submit"], input[type="reset"], input[type="button"] {
2
+
3
+ background: #eee; /* Old browsers */
4
+ background: -moz-linear-gradient(top, rgba(255,255,255,.2) 0%, rgba(0,0,0,.2) 100%); /* FF3.6+ */
5
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,.2)), color-stop(100%,rgba(0,0,0,.2))); /* Chrome,Safari4+ */
6
+ background: -webkit-linear-gradient(top, rgba(255,255,255,.2) 0%,rgba(0,0,0,.2) 100%); /* Chrome10+,Safari5.1+ */
7
+ background: -o-linear-gradient(top, rgba(255,255,255,.2) 0%,rgba(0,0,0,.2) 100%); /* Opera11.10+ */
8
+ background: -ms-linear-gradient(top, rgba(255,255,255,.2) 0%,rgba(0,0,0,.2) 100%); /* IE10+ */
9
+ background: linear-gradient(top, rgba(255,255,255,.2) 0%,rgba(0,0,0,.2) 100%); /* W3C */
10
+ border: 1px solid #aaa;
11
+ border-top: 1px solid #ccc;
12
+ border-left: 1px solid #ccc;
13
+ padding: 4px 12px;
14
+ -moz-border-radius: 3px;
15
+ -webkit-border-radius: 3px;
16
+ border-radius: 3px;
17
+ color: #444;
18
+ display: inline-block;
19
+ font-size: 11px;
20
+ font-weight: bold;
21
+ text-decoration: none;
22
+ text-shadow: 0 1px rgba(255, 255, 255, .75);
23
+ cursor: pointer;
24
+ margin-bottom: 20px;
25
+ line-height: 21px;
26
+ font-family: "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif;
27
+ }
28
+ a.button:hover, button:hover, input[type="submit"]:hover, input[type="reset"]:hover, input[type="button"]:hover {
29
+ color: #222;
30
+ background: #eee; /* Old browsers */
31
+ background: -moz-linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(0,0,0,.3) 100%); /* FF3.6+ */
32
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,.3)), color-stop(100%,rgba(0,0,0,.3))); /* Chrome,Safari4+ */
33
+ background: -webkit-linear-gradient(top, rgba(255,255,255,.3) 0%,rgba(0,0,0,.3) 100%); /* Chrome10+,Safari5.1+ */
34
+ background: -o-linear-gradient(top, rgba(255,255,255,.3) 0%,rgba(0,0,0,.3) 100%); /* Opera11.10+ */
35
+ background: -ms-linear-gradient(top, rgba(255,255,255,.3) 0%,rgba(0,0,0,.3) 100%); /* IE10+ */
36
+ background: linear-gradient(top, rgba(255,255,255,.3) 0%,rgba(0,0,0,.3) 100%); /* W3C */
37
+ border: 1px solid #888;
38
+ border-top: 1px solid #aaa;
39
+ border-left: 1px solid #aaa;
40
+ }
41
+
42
+ a.button:active, button:active, input[type="submit"]:active, input[type="reset"]:active, input[type="button"]:active {
43
+ background: #eee; /* Old browsers */
44
+ background: -moz-linear-gradient(top, rgba(0,0,0,.3) 0%, rgba(255,255,255,.3) 100%); /* FF3.6+ */
45
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(0,0,0,.3)), color-stop(100%,rgba(255,255,255,.3))); /* Chrome,Safari4+ */
46
+ background: -webkit-linear-gradient(top, rgba(0,0,0,.3) 0%,rgba(255,255,255,.3) 100%); /* Chrome10+,Safari5.1+ */
47
+ background: -o-linear-gradient(top, rgba(0,0,0,.3) 0%,rgba(255,255,255,.3) 100%); /* Opera11.10+ */
48
+ background: -ms-linear-gradient(top, rgba(0,0,0,.3) 0%,rgba(255,255,255,.3) 100%); /* IE10+ */
49
+ background: linear-gradient(top, rgba(0,0,0,.3) 0%,rgba(255,255,255,.3) 100%); /* W3C */
50
+ border: 1px solid #888;
51
+ border-bottom: 1px solid #aaa;
52
+ border-right: 1px solid #aaa;
53
+ }
54
+
55
+ .button.full-width, button.full-width, input[type="submit"].full-width, input[type="reset"].full-width, input[type="button"].full-width {
56
+ width: 100%;
57
+ padding-left: 0 !important;
58
+ padding-right: 0 !important;
59
+ text-align: center;
60
+ }
@@ -3,18 +3,18 @@ html {
3
3
  }
4
4
  body {
5
5
  color: #111111;
6
- background: url("../images/bg.gif") repeat scroll 0 0 #EBEBEB;
6
+ background: url("/assets/bg.gif") repeat scroll 0 0 #EBEBEB;
7
7
  }
8
8
 
9
9
  header {
10
10
  font-family: helvetica,arial,sans-serif;
11
11
  background: #333;
12
- padding: 0 20px;
13
12
  min-width: 960px;
13
+ width: 100%;
14
14
  nav {
15
15
  float: right;
16
- width: 100%;
17
16
  text-align: right;
17
+ margin: 0 20px 0 0;
18
18
  ul {
19
19
  list-style-type: none;
20
20
  margin: 7px 0 0;
@@ -42,9 +42,10 @@ header {
42
42
  border-top: 1px solid rgba(0, 0, 0, 0.2);
43
43
  border-left: 1px solid rgba(0, 0, 0, 0.2);
44
44
  font-size: 14px;
45
+ border-top-left-radius: 9px;
45
46
  h4 {
46
47
  font-weight: bold;
47
- font-size: 16 px;
48
+ font-size: 16px;
48
49
  margin: 0 0 10px 0;
49
50
  }
50
51
  li {
@@ -70,7 +71,7 @@ header {
70
71
  font-weight: bold;
71
72
  letter-spacing: -1px;
72
73
  line-height: 1.2em;
73
- padding: 15px 0;
74
+ padding: 15px 0 10px 20px;
74
75
  text-shadow: 1px 1px 2px #000000;
75
76
  text-transform: none;
76
77
  }
@@ -85,11 +86,12 @@ header {
85
86
  width: 71%;
86
87
  float: left;
87
88
  background: #fff;
89
+ padding: 20px;
88
90
  h3 {
89
91
  background-color: #F1F8FE;
90
92
  border-bottom: 1px solid #DADEE5;
91
93
  border-top: 1px solid #DADEE5;
92
- margin: 0;
94
+ margin: -20px -20px 20px -20px;
93
95
  padding: 15px 20px;
94
96
  font-size: 22px;
95
97
  font-style: normal;
@@ -98,7 +100,7 @@ header {
98
100
  line-height: 1.2em;
99
101
  text-transform: none;
100
102
  }
101
- h3.first {
103
+ h3 {
102
104
  border-top: none;
103
105
  border-top-left-radius: 9px;
104
106
  border-top-right-radius: 9px;
@@ -110,30 +112,35 @@ header {
110
112
  padding-bottom: 2px;
111
113
  }
112
114
  div.field, p {
113
- margin: 12px 20px;
114
- }
115
- p {
115
+ margin: 12px 0;
116
116
  font-size: 14px;
117
117
  line-height: 15px;
118
+ float:left;
119
+ width:100%;
120
+ input, textarea {
121
+ border: 1px solid #E2E2E2;
122
+ width: 100%;
123
+ font-size: 1.0em;
124
+ }
125
+ input:hover, textarea:hover {
126
+ border: 1px solid #A2A294;
127
+ box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
128
+ }
129
+ span.desc {
130
+ color: #8C8C8C;
131
+ font-size: 0.7em;
132
+ font-style: italic;
133
+ }
118
134
  }
119
- input, textarea {
120
- border: 1px solid #E2E2E2;
121
- width: 100%;
122
- font-size: 1.0em;
123
- }
124
- input:hover, textarea:hover {
125
- border: 1px solid #A2A294;
126
- box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
127
- }
128
- span.desc {
129
- color: #8C8C8C;
130
- font-size: 0.7em;
131
- font-style: italic;
135
+ div.actions {
136
+ margin: 20px 0;
137
+ float:left;
138
+ width:100%;
132
139
  }
133
140
  }
134
141
  #subcol {
135
142
  float: right;
136
- width: 25%;
143
+ width: 24%;
137
144
  .notice {
138
145
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
139
146
  border-radius: 9px 9px 9px 9px;
@@ -0,0 +1,2 @@
1
+ // Modernizr v1.7 www.modernizr.com
2
+ window.Modernizr=function(a,b,c){function G(){e.input=function(a){for(var b=0,c=a.length;b<c;b++)t[a[b]]=!!(a[b]in l);return t}("autocomplete autofocus list placeholder max min multiple pattern required step".split(" ")),e.inputtypes=function(a){for(var d=0,e,f,h,i=a.length;d<i;d++)l.setAttribute("type",f=a[d]),e=l.type!=="text",e&&(l.value=m,l.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(f)&&l.style.WebkitAppearance!==c?(g.appendChild(l),h=b.defaultView,e=h.getComputedStyle&&h.getComputedStyle(l,null).WebkitAppearance!=="textfield"&&l.offsetHeight!==0,g.removeChild(l)):/^(search|tel)$/.test(f)||(/^(url|email)$/.test(f)?e=l.checkValidity&&l.checkValidity()===!1:/^color$/.test(f)?(g.appendChild(l),g.offsetWidth,e=l.value!=m,g.removeChild(l)):e=l.value!=m)),s[a[d]]=!!e;return s}("search tel url email datetime date month week time datetime-local number range color".split(" "))}function F(a,b){var c=a.charAt(0).toUpperCase()+a.substr(1),d=(a+" "+p.join(c+" ")+c).split(" ");return!!E(d,b)}function E(a,b){for(var d in a)if(k[a[d]]!==c&&(!b||b(a[d],j)))return!0}function D(a,b){return(""+a).indexOf(b)!==-1}function C(a,b){return typeof a===b}function B(a,b){return A(o.join(a+";")+(b||""))}function A(a){k.cssText=a}var d="1.7",e={},f=!0,g=b.documentElement,h=b.head||b.getElementsByTagName("head")[0],i="modernizr",j=b.createElement(i),k=j.style,l=b.createElement("input"),m=":)",n=Object.prototype.toString,o=" -webkit- -moz- -o- -ms- -khtml- ".split(" "),p="Webkit Moz O ms Khtml".split(" "),q={svg:"http://www.w3.org/2000/svg"},r={},s={},t={},u=[],v,w=function(a){var c=b.createElement("style"),d=b.createElement("div"),e;c.textContent=a+"{#modernizr{height:3px}}",h.appendChild(c),d.id="modernizr",g.appendChild(d),e=d.offsetHeight===3,c.parentNode.removeChild(c),d.parentNode.removeChild(d);return!!e},x=function(){function d(d,e){e=e||b.createElement(a[d]||"div");var f=(d="on"+d)in e;f||(e.setAttribute||(e=b.createElement("div")),e.setAttribute&&e.removeAttribute&&(e.setAttribute(d,""),f=C(e[d],"function"),C(e[d],c)||(e[d]=c),e.removeAttribute(d))),e=null;return f}var a={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return d}(),y=({}).hasOwnProperty,z;C(y,c)||C(y.call,c)?z=function(a,b){return b in a&&C(a.constructor.prototype[b],c)}:z=function(a,b){return y.call(a,b)},r.flexbox=function(){function c(a,b,c,d){a.style.cssText=o.join(b+":"+c+";")+(d||"")}function a(a,b,c,d){b+=":",a.style.cssText=(b+o.join(c+";"+b)).slice(0,-b.length)+(d||"")}var d=b.createElement("div"),e=b.createElement("div");a(d,"display","box","width:42px;padding:0;"),c(e,"box-flex","1","width:10px;"),d.appendChild(e),g.appendChild(d);var f=e.offsetWidth===42;d.removeChild(e),g.removeChild(d);return f},r.canvas=function(){var a=b.createElement("canvas");return a.getContext&&a.getContext("2d")},r.canvastext=function(){return e.canvas&&C(b.createElement("canvas").getContext("2d").fillText,"function")},r.webgl=function(){return!!a.WebGLRenderingContext},r.touch=function(){return"ontouchstart"in a||w("@media ("+o.join("touch-enabled),(")+"modernizr)")},r.geolocation=function(){return!!navigator.geolocation},r.postmessage=function(){return!!a.postMessage},r.websqldatabase=function(){var b=!!a.openDatabase;return b},r.indexedDB=function(){for(var b=-1,c=p.length;++b<c;){var d=p[b].toLowerCase();if(a[d+"_indexedDB"]||a[d+"IndexedDB"])return!0}return!1},r.hashchange=function(){return x("hashchange",a)&&(b.documentMode===c||b.documentMode>7)},r.history=function(){return !!(a.history&&history.pushState)},r.draganddrop=function(){return x("dragstart")&&x("drop")},r.websockets=function(){return"WebSocket"in a},r.rgba=function(){A("background-color:rgba(150,255,150,.5)");return D(k.backgroundColor,"rgba")},r.hsla=function(){A("background-color:hsla(120,40%,100%,.5)");return D(k.backgroundColor,"rgba")||D(k.backgroundColor,"hsla")},r.multiplebgs=function(){A("background:url(//:),url(//:),red url(//:)");return(new RegExp("(url\\s*\\(.*?){3}")).test(k.background)},r.backgroundsize=function(){return F("backgroundSize")},r.borderimage=function(){return F("borderImage")},r.borderradius=function(){return F("borderRadius","",function(a){return D(a,"orderRadius")})},r.boxshadow=function(){return F("boxShadow")},r.textshadow=function(){return b.createElement("div").style.textShadow===""},r.opacity=function(){B("opacity:.55");return/^0.55$/.test(k.opacity)},r.cssanimations=function(){return F("animationName")},r.csscolumns=function(){return F("columnCount")},r.cssgradients=function(){var a="background-image:",b="gradient(linear,left top,right bottom,from(#9f9),to(white));",c="linear-gradient(left top,#9f9, white);";A((a+o.join(b+a)+o.join(c+a)).slice(0,-a.length));return D(k.backgroundImage,"gradient")},r.cssreflections=function(){return F("boxReflect")},r.csstransforms=function(){return!!E(["transformProperty","WebkitTransform","MozTransform","OTransform","msTransform"])},r.csstransforms3d=function(){var a=!!E(["perspectiveProperty","WebkitPerspective","MozPerspective","OPerspective","msPerspective"]);a&&"webkitPerspective"in g.style&&(a=w("@media ("+o.join("transform-3d),(")+"modernizr)"));return a},r.csstransitions=function(){return F("transitionProperty")},r.fontface=function(){var a,c,d=h||g,e=b.createElement("style"),f=b.implementation||{hasFeature:function(){return!1}};e.type="text/css",d.insertBefore(e,d.firstChild),a=e.sheet||e.styleSheet;var i=f.hasFeature("CSS2","")?function(b){if(!a||!b)return!1;var c=!1;try{a.insertRule(b,0),c=/src/i.test(a.cssRules[0].cssText),a.deleteRule(a.cssRules.length-1)}catch(d){}return c}:function(b){if(!a||!b)return!1;a.cssText=b;return a.cssText.length!==0&&/src/i.test(a.cssText)&&a.cssText.replace(/\r+|\n+/g,"").indexOf(b.split(" ")[0])===0};c=i('@font-face { font-family: "font"; src: url(data:,); }'),d.removeChild(e);return c},r.video=function(){var a=b.createElement("video"),c=!!a.canPlayType;if(c){c=new Boolean(c),c.ogg=a.canPlayType('video/ogg; codecs="theora"');var d='video/mp4; codecs="avc1.42E01E';c.h264=a.canPlayType(d+'"')||a.canPlayType(d+', mp4a.40.2"'),c.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"')}return c},r.audio=function(){var a=b.createElement("audio"),c=!!a.canPlayType;c&&(c=new Boolean(c),c.ogg=a.canPlayType('audio/ogg; codecs="vorbis"'),c.mp3=a.canPlayType("audio/mpeg;"),c.wav=a.canPlayType('audio/wav; codecs="1"'),c.m4a=a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;"));return c},r.localstorage=function(){try{return!!localStorage.getItem}catch(a){return!1}},r.sessionstorage=function(){try{return!!sessionStorage.getItem}catch(a){return!1}},r.webWorkers=function(){return!!a.Worker},r.applicationcache=function(){return!!a.applicationCache},r.svg=function(){return!!b.createElementNS&&!!b.createElementNS(q.svg,"svg").createSVGRect},r.inlinesvg=function(){var a=b.createElement("div");a.innerHTML="<svg/>";return(a.firstChild&&a.firstChild.namespaceURI)==q.svg},r.smil=function(){return!!b.createElementNS&&/SVG/.test(n.call(b.createElementNS(q.svg,"animate")))},r.svgclippaths=function(){return!!b.createElementNS&&/SVG/.test(n.call(b.createElementNS(q.svg,"clipPath")))};for(var H in r)z(r,H)&&(v=H.toLowerCase(),e[v]=r[H](),u.push((e[v]?"":"no-")+v));e.input||G(),e.crosswindowmessaging=e.postmessage,e.historymanagement=e.history,e.addTest=function(a,b){a=a.toLowerCase();if(!e[a]){b=!!b(),g.className+=" "+(b?"":"no-")+a,e[a]=b;return e}},A(""),j=l=null,f&&a.attachEvent&&function(){var a=b.createElement("div");a.innerHTML="<elem></elem>";return a.childNodes.length!==1}()&&function(a,b){function p(a,b){var c=-1,d=a.length,e,f=[];while(++c<d)e=a[c],(b=e.media||b)!="screen"&&f.push(p(e.imports,b),e.cssText);return f.join("")}function o(a){var b=-1;while(++b<e)a.createElement(d[b])}var c="abbr|article|aside|audio|canvas|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",d=c.split("|"),e=d.length,f=new RegExp("(^|\\s)("+c+")","gi"),g=new RegExp("<(/*)("+c+")","gi"),h=new RegExp("(^|[^\\n]*?\\s)("+c+")([^\\n]*)({[\\n\\w\\W]*?})","gi"),i=b.createDocumentFragment(),j=b.documentElement,k=j.firstChild,l=b.createElement("body"),m=b.createElement("style"),n;o(b),o(i),k.insertBefore(m,k.firstChild),m.media="print",a.attachEvent("onbeforeprint",function(){var a=-1,c=p(b.styleSheets,"all"),k=[],o;n=n||b.body;while((o=h.exec(c))!=null)k.push((o[1]+o[2]+o[3]).replace(f,"$1.iepp_$2")+o[4]);m.styleSheet.cssText=k.join("\n");while(++a<e){var q=b.getElementsByTagName(d[a]),r=q.length,s=-1;while(++s<r)q[s].className.indexOf("iepp_")<0&&(q[s].className+=" iepp_"+d[a])}i.appendChild(n),j.appendChild(l),l.className=n.className,l.innerHTML=n.innerHTML.replace(g,"<$1font")}),a.attachEvent("onafterprint",function(){l.innerHTML="",j.removeChild(l),j.appendChild(n),m.styleSheet.cssText=""})}(a,b),e._enableHTML5=f,e._version=d,g.className=g.className.replace(/\bno-js\b/,"")+" js "+u.join(" ");return e}(this,this.document)
metadata CHANGED
@@ -1,8 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: custom_layout
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 23
4
5
  prerelease:
5
- version: 0.0.3
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 4
10
+ version: 0.0.4
6
11
  platform: ruby
7
12
  authors:
8
13
  - Denis Jacquemin
@@ -10,8 +15,7 @@ autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
17
 
13
- date: 2010-08-06 00:00:00 +02:00
14
- default_executable:
18
+ date: 2010-08-08 00:00:00 Z
15
19
  dependencies: []
16
20
 
17
21
  description: Quickly add a nice layout
@@ -26,13 +30,14 @@ files:
26
30
  - lib/generators/custom_layout/custom_layout_generator.rb
27
31
  - lib/generators/custom_layout/templates/black_mamba/application.css
28
32
  - lib/generators/custom_layout/templates/black_mamba/bg.gif
33
+ - lib/generators/custom_layout/templates/black_mamba/button.css.scss
29
34
  - lib/generators/custom_layout/templates/black_mamba/layout.css.scss
30
35
  - lib/generators/custom_layout/templates/black_mamba/layout.html.erb
36
+ - lib/generators/custom_layout/templates/black_mamba/modernizr-1.7.min.js
31
37
  - lib/generators/custom_layout/templates/black_mamba/print.css
32
38
  - lib/generators/custom_layout/templates/black_mamba/reset.css
33
39
  - lib/generators/custom_layout/USAGE
34
- has_rdoc: true
35
- homepage: https://github.com/denisjacquemin/custom_layout
40
+ homepage: https://github.com/denisjacquemin/custom_layout_generator
36
41
  licenses: []
37
42
 
38
43
  post_install_message:
@@ -45,17 +50,23 @@ required_ruby_version: !ruby/object:Gem::Requirement
45
50
  requirements:
46
51
  - - ">="
47
52
  - !ruby/object:Gem::Version
53
+ hash: 3
54
+ segments:
55
+ - 0
48
56
  version: "0"
49
57
  required_rubygems_version: !ruby/object:Gem::Requirement
50
58
  none: false
51
59
  requirements:
52
60
  - - ">="
53
61
  - !ruby/object:Gem::Version
62
+ hash: 3
63
+ segments:
64
+ - 0
54
65
  version: "0"
55
66
  requirements: []
56
67
 
57
68
  rubyforge_project:
58
- rubygems_version: 1.6.2
69
+ rubygems_version: 1.8.7
59
70
  signing_key:
60
71
  specification_version: 3
61
72
  summary: Custom layout Rails generator