custom_layout 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/generators/custom_layout/USAGE +5 -1
- data/lib/generators/custom_layout/custom_layout_generator.rb +10 -7
- data/lib/generators/custom_layout/templates/black_mamba/application.css +8 -0
- data/lib/generators/custom_layout/templates/{bg.gif → black_mamba/bg.gif} +0 -0
- data/lib/generators/custom_layout/templates/{layout.css.scss.erb → black_mamba/layout.css.scss} +8 -4
- data/lib/generators/custom_layout/templates/{layout.html.erb → black_mamba/layout.html.erb} +22 -4
- data/lib/generators/custom_layout/templates/{print.css.erb → black_mamba/print.css} +0 -0
- data/lib/generators/custom_layout/templates/{reset.css.erb → black_mamba/reset.css} +0 -0
- metadata +8 -7
@@ -2,8 +2,12 @@ Description:
|
|
2
2
|
The custom_layout generator creates a nice html5 layout.
|
3
3
|
It replaces the existing default layout build by the scaffold generator.
|
4
4
|
|
5
|
+
The generator takes one argument which will be the name of the theme
|
6
|
+
to apply If no argument is passed then it defaults to "black_mamba".
|
7
|
+
|
5
8
|
Example:
|
6
9
|
rails generate custom_layout
|
7
10
|
|
8
11
|
This will create:
|
9
|
-
app/views/layouts/application.html.erb
|
12
|
+
app/views/layouts/application.html.erb
|
13
|
+
+ theme's files
|
@@ -1,5 +1,7 @@
|
|
1
|
-
class CustomLayoutGenerator < Rails::Generators::
|
2
|
-
source_root File.expand_path('../templates', __FILE__)
|
1
|
+
class CustomLayoutGenerator < Rails::Generators::Base
|
2
|
+
source_root File.expand_path('../templates', __FILE__)
|
3
|
+
argument :theme, :type => :string, :default => "black_mamba"
|
4
|
+
|
3
5
|
|
4
6
|
def remove_existing_layout
|
5
7
|
remove_file 'app/views/layouts/application.html.erb'
|
@@ -8,10 +10,11 @@ class CustomLayoutGenerator < Rails::Generators::NamedBase
|
|
8
10
|
end
|
9
11
|
|
10
12
|
def create_new_layout
|
11
|
-
template "layout.html.erb", "app/views/layouts/application.html.erb"
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
template "#{theme}/layout.html.erb", "app/views/layouts/application.html.erb"
|
14
|
+
copy_file "#{theme}/reset.css", "app/assets/stylesheets/reset.css"
|
15
|
+
copy_file "#{theme}/print.css", "app/assets/stylesheets/print.css"
|
16
|
+
copy_file "#{theme}/application.css", "app/assets/stylesheets/application.css"
|
17
|
+
copy_file "#{theme}/layout.css.scss", "app/assets/stylesheets/layout.css.scss"
|
18
|
+
template "#{theme}/bg.gif", "app/assets/images/bg.gif"
|
16
19
|
end
|
17
20
|
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll automatically include all the stylesheets available in this directory
|
3
|
+
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
|
4
|
+
* the top of the compiled file, but it's generally better to create a new file per style scope.
|
5
|
+
*= require_self
|
6
|
+
*= require reset
|
7
|
+
*= require_tree .
|
8
|
+
*/
|
File without changes
|
data/lib/generators/custom_layout/templates/{layout.css.scss.erb → black_mamba/layout.css.scss}
RENAMED
@@ -2,31 +2,35 @@ html {
|
|
2
2
|
overflow-y: scroll;
|
3
3
|
}
|
4
4
|
body {
|
5
|
-
color
|
6
|
-
font-family: helvetica,arial,sans-serif;
|
5
|
+
color: #111111;
|
7
6
|
background: url("../images/bg.gif") repeat scroll 0 0 #EBEBEB;
|
8
7
|
}
|
9
8
|
|
10
9
|
header {
|
10
|
+
font-family: helvetica,arial,sans-serif;
|
11
11
|
background: #333;
|
12
12
|
padding: 0 20px;
|
13
13
|
min-width: 960px;
|
14
14
|
nav {
|
15
15
|
float: right;
|
16
16
|
width: 100%;
|
17
|
-
text-align:right;
|
17
|
+
text-align: right;
|
18
18
|
ul {
|
19
19
|
list-style-type: none;
|
20
|
-
margin: 0;
|
20
|
+
margin: 7px 0 0;
|
21
21
|
padding: 0;
|
22
22
|
li {
|
23
23
|
padding: 0;
|
24
|
+
display :inline;
|
24
25
|
a {
|
25
26
|
color: #FFFFFF;
|
26
27
|
padding: 10px;
|
27
28
|
text-decoration: none;
|
28
29
|
font-size: 12px;
|
29
30
|
}
|
31
|
+
a:hover {
|
32
|
+
text-decoration: underline;
|
33
|
+
}
|
30
34
|
}
|
31
35
|
}
|
32
36
|
}
|
@@ -18,19 +18,37 @@
|
|
18
18
|
<link rel="shortcut icon" href="/favicon.ico">
|
19
19
|
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
|
20
20
|
<script src="assets/modernizr-1.7.min.js"></script>
|
21
|
+
<%%= csrf_meta_tag %>
|
21
22
|
</head>
|
22
23
|
<body>
|
23
24
|
<header>
|
24
25
|
<nav>
|
26
|
+
<ul>
|
27
|
+
<li><a href="#">menu</a></li>
|
28
|
+
<li><a href="#">menu</a></li>
|
29
|
+
<li><a href="#">logout</a></li>
|
30
|
+
</ul>
|
25
31
|
</nav>
|
32
|
+
<div id="msg" class="notice">
|
33
|
+
<h4>Some messages to read</h4>
|
34
|
+
<ul>
|
35
|
+
<li>consectetur <a href="#">elit</a>, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</li>
|
36
|
+
<li>Lorem ipsum dolor sit amet</li>
|
37
|
+
</ul>
|
38
|
+
</div>
|
39
|
+
<h1>Title</h1>
|
26
40
|
</header>
|
27
|
-
<div
|
28
|
-
|
29
|
-
|
30
|
-
|
41
|
+
<div id="container">
|
42
|
+
<div id="maincol">
|
43
|
+
<%%= yield %>
|
44
|
+
</div>
|
45
|
+
<div id="subcol">
|
46
|
+
<%%= yield :subcol %>
|
47
|
+
</div>
|
31
48
|
</container>
|
32
49
|
<footer>
|
33
50
|
</footer>
|
51
|
+
<%%= javascript_include_tag :defaults %>
|
34
52
|
|
35
53
|
<!-- Change UA-XXXXX-X to be your site's ID -->
|
36
54
|
<script>
|
File without changes
|
File without changes
|
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.3
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Denis Jacquemin
|
@@ -14,7 +14,7 @@ date: 2010-08-06 00:00:00 +02:00
|
|
14
14
|
default_executable:
|
15
15
|
dependencies: []
|
16
16
|
|
17
|
-
description: Quickly add a nice layout
|
17
|
+
description: Quickly add a nice layout
|
18
18
|
email: denis.jacquemin@gmail.com
|
19
19
|
executables: []
|
20
20
|
|
@@ -24,11 +24,12 @@ extra_rdoc_files: []
|
|
24
24
|
|
25
25
|
files:
|
26
26
|
- lib/generators/custom_layout/custom_layout_generator.rb
|
27
|
-
- lib/generators/custom_layout/templates/
|
28
|
-
- lib/generators/custom_layout/templates/
|
29
|
-
- lib/generators/custom_layout/templates/layout.
|
30
|
-
- lib/generators/custom_layout/templates/
|
31
|
-
- lib/generators/custom_layout/templates/
|
27
|
+
- lib/generators/custom_layout/templates/black_mamba/application.css
|
28
|
+
- lib/generators/custom_layout/templates/black_mamba/bg.gif
|
29
|
+
- lib/generators/custom_layout/templates/black_mamba/layout.css.scss
|
30
|
+
- lib/generators/custom_layout/templates/black_mamba/layout.html.erb
|
31
|
+
- lib/generators/custom_layout/templates/black_mamba/print.css
|
32
|
+
- lib/generators/custom_layout/templates/black_mamba/reset.css
|
32
33
|
- lib/generators/custom_layout/USAGE
|
33
34
|
has_rdoc: true
|
34
35
|
homepage: https://github.com/denisjacquemin/custom_layout
|