custom_layout 0.0.1 → 0.0.2
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.
- data/lib/generators/custom_layout/USAGE +9 -0
- data/lib/generators/custom_layout/custom_layout_generator.rb +17 -0
- data/lib/generators/custom_layout/templates/bg.gif +0 -0
- data/lib/generators/custom_layout/templates/layout.css.scss.erb +183 -0
- data/lib/generators/custom_layout/templates/layout.html.erb +44 -0
- data/lib/generators/custom_layout/templates/print.css.erb +19 -0
- data/lib/generators/custom_layout/templates/reset.css.erb +25 -0
- metadata +9 -3
@@ -0,0 +1,17 @@
|
|
1
|
+
class CustomLayoutGenerator < Rails::Generators::NamedBase
|
2
|
+
source_root File.expand_path('../templates', __FILE__)
|
3
|
+
|
4
|
+
def remove_existing_layout
|
5
|
+
remove_file 'app/views/layouts/application.html.erb'
|
6
|
+
remove_file 'app/assets/stylesheets/scaffolds.css.scss'
|
7
|
+
remove_file 'app/assets/images/rails.png'
|
8
|
+
end
|
9
|
+
|
10
|
+
def create_new_layout
|
11
|
+
template "layout.html.erb", "app/views/layouts/application.html.erb"
|
12
|
+
template "reset.css.erb", "app/assets/stylesheets/reset.css"
|
13
|
+
template "print.css.erb", "app/assets/stylesheets/print.css"
|
14
|
+
template "layout.css.scss.erb", "app/assets/stylesheets/layout.css.scss"
|
15
|
+
template "bg.gif", "app/assets/images/bg.gif"
|
16
|
+
end
|
17
|
+
end
|
Binary file
|
@@ -0,0 +1,183 @@
|
|
1
|
+
html {
|
2
|
+
overflow-y: scroll;
|
3
|
+
}
|
4
|
+
body {
|
5
|
+
color:; #111111;
|
6
|
+
font-family: helvetica,arial,sans-serif;
|
7
|
+
background: url("../images/bg.gif") repeat scroll 0 0 #EBEBEB;
|
8
|
+
}
|
9
|
+
|
10
|
+
header {
|
11
|
+
background: #333;
|
12
|
+
padding: 0 20px;
|
13
|
+
min-width: 960px;
|
14
|
+
nav {
|
15
|
+
float: right;
|
16
|
+
width: 100%;
|
17
|
+
text-align:right;
|
18
|
+
ul {
|
19
|
+
list-style-type: none;
|
20
|
+
margin: 0;
|
21
|
+
padding: 0;
|
22
|
+
li {
|
23
|
+
padding: 0;
|
24
|
+
a {
|
25
|
+
color: #FFFFFF;
|
26
|
+
padding: 10px;
|
27
|
+
text-decoration: none;
|
28
|
+
font-size: 12px;
|
29
|
+
}
|
30
|
+
}
|
31
|
+
}
|
32
|
+
}
|
33
|
+
#msg {
|
34
|
+
position: fixed;
|
35
|
+
right: 0;
|
36
|
+
bottom: 0;
|
37
|
+
padding: 10px;
|
38
|
+
border-top: 1px solid rgba(0, 0, 0, 0.2);
|
39
|
+
border-left: 1px solid rgba(0, 0, 0, 0.2);
|
40
|
+
font-size: 14px;
|
41
|
+
h4 {
|
42
|
+
font-weight: bold;
|
43
|
+
font-size: 16 px;
|
44
|
+
margin: 0 0 10px 0;
|
45
|
+
}
|
46
|
+
li {
|
47
|
+
line-height: 20px;
|
48
|
+
}
|
49
|
+
}
|
50
|
+
#msg.notice {
|
51
|
+
background: none repeat scroll 0 0 rgba(167, 232, 162, 0.6);
|
52
|
+
}
|
53
|
+
#msg.notice:hover {
|
54
|
+
background: none repeat scroll 0 0 rgba(167, 232, 162, 1);
|
55
|
+
}
|
56
|
+
#msg.warning {
|
57
|
+
background: none repeat scroll 0 0 rgba(224, 113, 83, 0.6);
|
58
|
+
}
|
59
|
+
#msg.warning:hover {
|
60
|
+
background: none repeat scroll 0 0 rgba(224, 113, 83, 1);
|
61
|
+
}
|
62
|
+
h1 {
|
63
|
+
color: #FFFFFF;
|
64
|
+
font-size: 32px;
|
65
|
+
font-style: normal;
|
66
|
+
font-weight: bold;
|
67
|
+
letter-spacing: -1px;
|
68
|
+
line-height: 1.2em;
|
69
|
+
padding: 15px 0;
|
70
|
+
text-shadow: 1px 1px 2px #000000;
|
71
|
+
text-transform: none;
|
72
|
+
}
|
73
|
+
}
|
74
|
+
|
75
|
+
#container {
|
76
|
+
min-width: 960px;
|
77
|
+
padding: 20px;
|
78
|
+
#maincol {
|
79
|
+
border-radius: 9px 9px 9px 9px;
|
80
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
|
81
|
+
width: 71%;
|
82
|
+
float: left;
|
83
|
+
background: #fff;
|
84
|
+
h3 {
|
85
|
+
background-color: #F1F8FE;
|
86
|
+
border-bottom: 1px solid #DADEE5;
|
87
|
+
border-top: 1px solid #DADEE5;
|
88
|
+
margin: 0;
|
89
|
+
padding: 15px 20px;
|
90
|
+
font-size: 22px;
|
91
|
+
font-style: normal;
|
92
|
+
font-weight: bold;
|
93
|
+
letter-spacing: -1px;
|
94
|
+
line-height: 1.2em;
|
95
|
+
text-transform: none;
|
96
|
+
}
|
97
|
+
h3.first {
|
98
|
+
border-top: none;
|
99
|
+
border-top-left-radius: 9px;
|
100
|
+
border-top-right-radius: 9px;
|
101
|
+
}
|
102
|
+
label {
|
103
|
+
color: #666666;
|
104
|
+
display: block;
|
105
|
+
font-weight: bold;
|
106
|
+
padding-bottom: 2px;
|
107
|
+
}
|
108
|
+
div.field, p {
|
109
|
+
margin: 12px 20px;
|
110
|
+
}
|
111
|
+
p {
|
112
|
+
font-size: 14px;
|
113
|
+
line-height: 15px;
|
114
|
+
}
|
115
|
+
input, textarea {
|
116
|
+
border: 1px solid #E2E2E2;
|
117
|
+
width: 100%;
|
118
|
+
font-size: 1.0em;
|
119
|
+
}
|
120
|
+
input:hover, textarea:hover {
|
121
|
+
border: 1px solid #A2A294;
|
122
|
+
box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
|
123
|
+
}
|
124
|
+
span.desc {
|
125
|
+
color: #8C8C8C;
|
126
|
+
font-size: 0.7em;
|
127
|
+
font-style: italic;
|
128
|
+
}
|
129
|
+
}
|
130
|
+
#subcol {
|
131
|
+
float: right;
|
132
|
+
width: 25%;
|
133
|
+
.notice {
|
134
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
|
135
|
+
border-radius: 9px 9px 9px 9px;
|
136
|
+
background: #fff;
|
137
|
+
padding: 10px;
|
138
|
+
h4 {
|
139
|
+
font-weight: bold;
|
140
|
+
padding: 10px 2px;
|
141
|
+
border-bottom: 1px solid #C0C0C0;
|
142
|
+
color: #111111;
|
143
|
+
font-size: 13px;
|
144
|
+
margin: 0 0 10px 0;
|
145
|
+
}
|
146
|
+
p {
|
147
|
+
color: #111111;
|
148
|
+
font-size: 12px;
|
149
|
+
padding: 0 7px;
|
150
|
+
line-height: 14px;
|
151
|
+
margin: 10px 0;
|
152
|
+
}
|
153
|
+
}
|
154
|
+
}
|
155
|
+
}
|
156
|
+
|
157
|
+
footer {
|
158
|
+
clear:both;
|
159
|
+
min-width: 960px;
|
160
|
+
dl {
|
161
|
+
float: left;
|
162
|
+
font-size: 0.8em;
|
163
|
+
display: block;
|
164
|
+
margin: 1em 0 1em 2em;
|
165
|
+
dt {
|
166
|
+
color: #444444;
|
167
|
+
display: block;
|
168
|
+
font-weight: bold;
|
169
|
+
margin: 0 0 6px;
|
170
|
+
padding: 0;
|
171
|
+
white-space: nowrap;
|
172
|
+
}
|
173
|
+
dd, dd a {
|
174
|
+
color: #666666;
|
175
|
+
display: block;
|
176
|
+
font-weight: 200;
|
177
|
+
margin: 0 0 3px;
|
178
|
+
padding: 0;
|
179
|
+
text-decoration: none;
|
180
|
+
font-size: 0.95em;
|
181
|
+
}
|
182
|
+
}
|
183
|
+
}
|
@@ -0,0 +1,44 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<!--[if lt IE 7 ]><html class="ie ie6" lang="en"> <![endif]-->
|
3
|
+
<!--[if IE 7 ]><html class="ie ie7" lang="en"> <![endif]-->
|
4
|
+
<!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]-->
|
5
|
+
<!--[if (gte IE 9)|!(IE)]><!--><html lang="en"> <!--<![endif]-->
|
6
|
+
<head>
|
7
|
+
<meta charset="utf-8" />
|
8
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
9
|
+
|
10
|
+
<title>Nice Layout ;)</title>
|
11
|
+
<meta name="description" content="Nice Layout">
|
12
|
+
<meta name="author" content="Denis Jacquemin">
|
13
|
+
<!--[if lt IE 9]>
|
14
|
+
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
|
15
|
+
<![endif]-->
|
16
|
+
<%%= stylesheet_link_tag "application" %>
|
17
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
|
18
|
+
<link rel="shortcut icon" href="/favicon.ico">
|
19
|
+
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
|
20
|
+
<script src="assets/modernizr-1.7.min.js"></script>
|
21
|
+
</head>
|
22
|
+
<body>
|
23
|
+
<header>
|
24
|
+
<nav>
|
25
|
+
</nav>
|
26
|
+
</header>
|
27
|
+
<div class="container">
|
28
|
+
<%%= yield %>
|
29
|
+
<div id="maincol"></div>
|
30
|
+
<div id="subcol"></div>
|
31
|
+
</container>
|
32
|
+
<footer>
|
33
|
+
</footer>
|
34
|
+
|
35
|
+
<!-- Change UA-XXXXX-X to be your site's ID -->
|
36
|
+
<script>
|
37
|
+
var _gaq=[["_setAccount","UA-XXXXX-X"],["_trackPageview"]];
|
38
|
+
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.async=1;
|
39
|
+
g.src=("https:"==location.protocol?"//ssl":"//www")+".google-analytics.com/ga.js";
|
40
|
+
s.parentNode.insertBefore(g,s)}(document,"script"));
|
41
|
+
</script>
|
42
|
+
</body>
|
43
|
+
</html>
|
44
|
+
|
@@ -0,0 +1,19 @@
|
|
1
|
+
/**
|
2
|
+
* Print styles.
|
3
|
+
*
|
4
|
+
* Inlined to avoid required HTTP connection: www.phpied.com/delay-loading-your-print-css/
|
5
|
+
*/
|
6
|
+
@media print {
|
7
|
+
* { background: transparent !important; color: black !important; text-shadow: none !important; filter:none !important;
|
8
|
+
-ms-filter: none !important; } /* Black prints faster: sanbeiji.com/archives/953 */
|
9
|
+
a, a:visited { color: #444 !important; text-decoration: underline; }
|
10
|
+
a[href]:after { content: " (" attr(href) ")"; }
|
11
|
+
abbr[title]:after { content: " (" attr(title) ")"; }
|
12
|
+
.ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; } /* Don't show links for images, or javascript/internal links */
|
13
|
+
pre, blockquote { border: 1px solid #999; page-break-inside: avoid; }
|
14
|
+
thead { display: table-header-group; } /* css-discuss.incutio.com/wiki/Printing_Tables */
|
15
|
+
tr, img { page-break-inside: avoid; }
|
16
|
+
@page { margin: 0.5cm; }
|
17
|
+
p, h2, h3 { orphans: 3; widows: 3; }
|
18
|
+
h2, h3{ page-break-after: avoid; }
|
19
|
+
}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
/* #Reset & Basics (Inspired by E. Meyers)
|
2
|
+
================================================== */
|
3
|
+
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
|
4
|
+
margin: 0;
|
5
|
+
padding: 0;
|
6
|
+
border: 0;
|
7
|
+
font-size: 100%;
|
8
|
+
font: inherit;
|
9
|
+
vertical-align: baseline; }
|
10
|
+
article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {
|
11
|
+
display: block; }
|
12
|
+
body {
|
13
|
+
line-height: 1; }
|
14
|
+
ol, ul {
|
15
|
+
list-style: none; }
|
16
|
+
blockquote, q {
|
17
|
+
quotes: none; }
|
18
|
+
blockquote:before, blockquote:after,
|
19
|
+
q:before, q:after {
|
20
|
+
content: '';
|
21
|
+
content: none; }
|
22
|
+
table {
|
23
|
+
border-collapse: collapse;
|
24
|
+
border-spacing: 0; }
|
25
|
+
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: custom_layout
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Denis Jacquemin
|
@@ -22,8 +22,14 @@ extensions: []
|
|
22
22
|
|
23
23
|
extra_rdoc_files: []
|
24
24
|
|
25
|
-
files:
|
26
|
-
|
25
|
+
files:
|
26
|
+
- lib/generators/custom_layout/custom_layout_generator.rb
|
27
|
+
- lib/generators/custom_layout/templates/bg.gif
|
28
|
+
- lib/generators/custom_layout/templates/layout.css.scss.erb
|
29
|
+
- lib/generators/custom_layout/templates/layout.html.erb
|
30
|
+
- lib/generators/custom_layout/templates/print.css.erb
|
31
|
+
- lib/generators/custom_layout/templates/reset.css.erb
|
32
|
+
- lib/generators/custom_layout/USAGE
|
27
33
|
has_rdoc: true
|
28
34
|
homepage: https://github.com/denisjacquemin/custom_layout
|
29
35
|
licenses: []
|