iain-pizza-generators 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +67 -0
- data/LICENSE +20 -0
- data/README.rdoc +238 -0
- data/Rakefile +16 -0
- data/TODO +7 -0
- data/lib/pizza_generators.rb +3 -0
- data/pizza-generators.gemspec +53 -0
- data/rails_generators/pizza_authentication/USAGE +46 -0
- data/rails_generators/pizza_authentication/lib/insert_commands.rb +74 -0
- data/rails_generators/pizza_authentication/pizza_authentication_generator.rb +123 -0
- data/rails_generators/pizza_authentication/templates/authentication.rb +43 -0
- data/rails_generators/pizza_authentication/templates/fixtures.yml +26 -0
- data/rails_generators/pizza_authentication/templates/migration.rb +33 -0
- data/rails_generators/pizza_authentication/templates/session.rb +3 -0
- data/rails_generators/pizza_authentication/templates/sessions_controller.rb +24 -0
- data/rails_generators/pizza_authentication/templates/sessions_helper.rb +2 -0
- data/rails_generators/pizza_authentication/templates/tests/rspec/sessions_controller.rb +45 -0
- data/rails_generators/pizza_authentication/templates/tests/rspec/user.rb +45 -0
- data/rails_generators/pizza_authentication/templates/tests/rspec/users_controller.rb +33 -0
- data/rails_generators/pizza_authentication/templates/tests/shoulda/sessions_controller.rb +44 -0
- data/rails_generators/pizza_authentication/templates/tests/shoulda/user.rb +83 -0
- data/rails_generators/pizza_authentication/templates/tests/shoulda/users_controller.rb +25 -0
- data/rails_generators/pizza_authentication/templates/tests/testunit/sessions_controller.rb +32 -0
- data/rails_generators/pizza_authentication/templates/tests/testunit/user.rb +86 -0
- data/rails_generators/pizza_authentication/templates/tests/testunit/users_controller.rb +21 -0
- data/rails_generators/pizza_authentication/templates/user.rb +3 -0
- data/rails_generators/pizza_authentication/templates/users_controller.rb +13 -0
- data/rails_generators/pizza_authentication/templates/users_helper.rb +2 -0
- data/rails_generators/pizza_authentication/templates/views/erb/login.html.erb +15 -0
- data/rails_generators/pizza_authentication/templates/views/erb/signup.html.erb +24 -0
- data/rails_generators/pizza_authentication/templates/views/haml/login.html.haml +15 -0
- data/rails_generators/pizza_authentication/templates/views/haml/signup.html.haml +19 -0
- data/rails_generators/pizza_config/USAGE +23 -0
- data/rails_generators/pizza_config/pizza_config_generator.rb +32 -0
- data/rails_generators/pizza_config/templates/config.yml +8 -0
- data/rails_generators/pizza_config/templates/load_config.rb +2 -0
- data/rails_generators/pizza_layout/USAGE +25 -0
- data/rails_generators/pizza_layout/pizza_layout_generator.rb +55 -0
- data/rails_generators/pizza_layout/templates/_menu.html.haml +4 -0
- data/rails_generators/pizza_layout/templates/application.sass +5 -0
- data/rails_generators/pizza_layout/templates/definition_lists.sass +8 -0
- data/rails_generators/pizza_layout/templates/forms.sass +79 -0
- data/rails_generators/pizza_layout/templates/helper.rb +41 -0
- data/rails_generators/pizza_layout/templates/layout.html.erb +22 -0
- data/rails_generators/pizza_layout/templates/layout.html.haml +25 -0
- data/rails_generators/pizza_layout/templates/layout.sass +121 -0
- data/rails_generators/pizza_layout/templates/required.png +0 -0
- data/rails_generators/pizza_layout/templates/reset.sass +39 -0
- data/rails_generators/pizza_layout/templates/stylesheet.css +81 -0
- data/rails_generators/pizza_layout/templates/tables.sass +23 -0
- data/rails_generators/pizza_layout/templates/will_paginate.rb +9 -0
- data/rails_generators/pizza_scaffold/USAGE +51 -0
- data/rails_generators/pizza_scaffold/pizza_scaffold_generator.rb +233 -0
- data/rails_generators/pizza_scaffold/templates/actions/create.rb +4 -0
- data/rails_generators/pizza_scaffold/templates/actions/destroy.rb +4 -0
- data/rails_generators/pizza_scaffold/templates/actions/edit.rb +0 -0
- data/rails_generators/pizza_scaffold/templates/actions/index.rb +3 -0
- data/rails_generators/pizza_scaffold/templates/actions/new.rb +0 -0
- data/rails_generators/pizza_scaffold/templates/actions/show.rb +0 -0
- data/rails_generators/pizza_scaffold/templates/actions/update.rb +4 -0
- data/rails_generators/pizza_scaffold/templates/controller.rb +11 -0
- data/rails_generators/pizza_scaffold/templates/fixtures.yml +9 -0
- data/rails_generators/pizza_scaffold/templates/helper.rb +2 -0
- data/rails_generators/pizza_scaffold/templates/migration.rb +16 -0
- data/rails_generators/pizza_scaffold/templates/model.rb +21 -0
- data/rails_generators/pizza_scaffold/templates/tests/rspec/actions/create.rb +15 -0
- data/rails_generators/pizza_scaffold/templates/tests/rspec/actions/destroy.rb +10 -0
- data/rails_generators/pizza_scaffold/templates/tests/rspec/actions/edit.rb +8 -0
- data/rails_generators/pizza_scaffold/templates/tests/rspec/actions/index.rb +8 -0
- data/rails_generators/pizza_scaffold/templates/tests/rspec/actions/new.rb +8 -0
- data/rails_generators/pizza_scaffold/templates/tests/rspec/actions/show.rb +8 -0
- data/rails_generators/pizza_scaffold/templates/tests/rspec/actions/update.rb +15 -0
- data/rails_generators/pizza_scaffold/templates/tests/rspec/controller.rb +8 -0
- data/rails_generators/pizza_scaffold/templates/tests/rspec/model.rb +7 -0
- data/rails_generators/pizza_scaffold/templates/tests/shoulda/actions/create.rb +13 -0
- data/rails_generators/pizza_scaffold/templates/tests/shoulda/actions/destroy.rb +8 -0
- data/rails_generators/pizza_scaffold/templates/tests/shoulda/actions/edit.rb +6 -0
- data/rails_generators/pizza_scaffold/templates/tests/shoulda/actions/index.rb +6 -0
- data/rails_generators/pizza_scaffold/templates/tests/shoulda/actions/new.rb +6 -0
- data/rails_generators/pizza_scaffold/templates/tests/shoulda/actions/show.rb +6 -0
- data/rails_generators/pizza_scaffold/templates/tests/shoulda/actions/update.rb +13 -0
- data/rails_generators/pizza_scaffold/templates/tests/shoulda/controller.rb +5 -0
- data/rails_generators/pizza_scaffold/templates/tests/shoulda/model.rb +7 -0
- data/rails_generators/pizza_scaffold/templates/tests/testunit/actions/create.rb +11 -0
- data/rails_generators/pizza_scaffold/templates/tests/testunit/actions/destroy.rb +6 -0
- data/rails_generators/pizza_scaffold/templates/tests/testunit/actions/edit.rb +4 -0
- data/rails_generators/pizza_scaffold/templates/tests/testunit/actions/index.rb +4 -0
- data/rails_generators/pizza_scaffold/templates/tests/testunit/actions/new.rb +4 -0
- data/rails_generators/pizza_scaffold/templates/tests/testunit/actions/show.rb +4 -0
- data/rails_generators/pizza_scaffold/templates/tests/testunit/actions/update.rb +11 -0
- data/rails_generators/pizza_scaffold/templates/tests/testunit/controller.rb +5 -0
- data/rails_generators/pizza_scaffold/templates/tests/testunit/model.rb +7 -0
- data/rails_generators/pizza_scaffold/templates/views/erb/_form.html.erb +10 -0
- data/rails_generators/pizza_scaffold/templates/views/erb/edit.html.erb +14 -0
- data/rails_generators/pizza_scaffold/templates/views/erb/index.html.erb +29 -0
- data/rails_generators/pizza_scaffold/templates/views/erb/new.html.erb +7 -0
- data/rails_generators/pizza_scaffold/templates/views/erb/show.html.erb +20 -0
- data/rails_generators/pizza_scaffold/templates/views/haml/_form.html.haml +10 -0
- data/rails_generators/pizza_scaffold/templates/views/haml/edit.html.haml +13 -0
- data/rails_generators/pizza_scaffold/templates/views/haml/index.html.haml +31 -0
- data/rails_generators/pizza_scaffold/templates/views/haml/new.html.haml +8 -0
- data/rails_generators/pizza_scaffold/templates/views/haml/show.html.haml +17 -0
- data/tasks/deployment.rake +5 -0
- data/test/test_helper.rb +117 -0
- data/test/test_pizza_authentication_generator.rb +158 -0
- data/test/test_pizza_config_generator.rb +37 -0
- data/test/test_pizza_layout_generator.rb +42 -0
- data/test/test_pizza_scaffold_generator.rb +532 -0
- metadata +237 -0
@@ -0,0 +1,23 @@
|
|
1
|
+
Description:
|
2
|
+
The pizza_config generator creates YAML file in your config
|
3
|
+
directory and an initializer to load this config. The config has a
|
4
|
+
separate section for each environment. This is a great place to put
|
5
|
+
any config settings you don't want in your app.
|
6
|
+
|
7
|
+
The config is loaded into a constant called APP_CONFIG by default,
|
8
|
+
this changes depending on the name you choose to pass the generator.
|
9
|
+
Use this constant to access the config settings like this.
|
10
|
+
|
11
|
+
APP_CONFIG[:some_setting]
|
12
|
+
|
13
|
+
|
14
|
+
Examples:
|
15
|
+
script/generate pizza_config
|
16
|
+
|
17
|
+
Config: config/app_config.yml
|
18
|
+
Initializer: config/initializers/load_app_config.rb
|
19
|
+
|
20
|
+
script/generate pizza_config passwords
|
21
|
+
|
22
|
+
Config: config/passwords_config.yml
|
23
|
+
Initializer: config/initializers/load_passwords_config.rb
|
@@ -0,0 +1,32 @@
|
|
1
|
+
class PizzaConfigGenerator < Rails::Generator::Base
|
2
|
+
def initialize(runtime_args, runtime_options = {})
|
3
|
+
super
|
4
|
+
@name = @args.first || 'app'
|
5
|
+
end
|
6
|
+
|
7
|
+
def manifest
|
8
|
+
record do |m|
|
9
|
+
m.directory 'config/initializers'
|
10
|
+
|
11
|
+
m.template "load_config.rb", "config/initializers/load_#{file_name}_config.rb"
|
12
|
+
m.file "config.yml", "config/#{file_name}_config.yml"
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def file_name
|
17
|
+
@name.underscore
|
18
|
+
end
|
19
|
+
|
20
|
+
def constant_name
|
21
|
+
@name.underscore.upcase
|
22
|
+
end
|
23
|
+
|
24
|
+
protected
|
25
|
+
def banner
|
26
|
+
<<-EOS
|
27
|
+
Creates config and loader files.
|
28
|
+
|
29
|
+
USAGE: #{$0} #{spec.name} [config_name]
|
30
|
+
EOS
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
Description:
|
2
|
+
The pizza_layout generator creates a basic layout, stylesheet and
|
3
|
+
helper which will give some structure to a starting Rails app.
|
4
|
+
|
5
|
+
The generator takes one argument which will be the name of the
|
6
|
+
layout and stylesheet files. If no argument is passed then it defaults
|
7
|
+
to "application".
|
8
|
+
|
9
|
+
The helper module includes some methods which can be called in any
|
10
|
+
template or partial to set variables to be used in the layout, such as
|
11
|
+
page title and javascript/stylesheet includes.
|
12
|
+
|
13
|
+
Examples:
|
14
|
+
script/generate pizza_layout
|
15
|
+
|
16
|
+
Layout: app/views/layouts/application.html.erb
|
17
|
+
Stylesheet: public/stylesheets/application.css
|
18
|
+
Helper: app/helpers/layout_helper.rb
|
19
|
+
|
20
|
+
|
21
|
+
script/generate pizza_layout admin
|
22
|
+
|
23
|
+
Layout: app/views/layouts/admin.html.erb
|
24
|
+
Stylesheet: public/stylesheets/admin.css
|
25
|
+
Helper: app/helpers/layout_helper.rb
|
@@ -0,0 +1,55 @@
|
|
1
|
+
class PizzaLayoutGenerator < Rails::Generator::Base
|
2
|
+
def initialize(runtime_args, runtime_options = {})
|
3
|
+
super
|
4
|
+
@name = @args.first || 'application'
|
5
|
+
end
|
6
|
+
|
7
|
+
def manifest
|
8
|
+
record do |m|
|
9
|
+
m.directory 'app/views/layouts'
|
10
|
+
m.directory 'public/stylesheets'
|
11
|
+
m.directory 'public/images'
|
12
|
+
m.directory 'app/helpers'
|
13
|
+
m.directory 'app/views/shared'
|
14
|
+
m.directory 'config/initializers'
|
15
|
+
|
16
|
+
if options[:erb]
|
17
|
+
m.template "layout.html.erb", "app/views/layouts/#{file_name}.html.erb"
|
18
|
+
m.file "stylesheet.css", "public/stylesheets/#{file_name}.css"
|
19
|
+
else
|
20
|
+
m.directory 'public/stylesheets/sass'
|
21
|
+
m.template "layout.html.haml", "app/views/layouts/#{file_name}.html.haml"
|
22
|
+
m.file "_menu.html.haml", "app/views/shared/_menu.html.haml"
|
23
|
+
m.file "application.sass", "public/stylesheets/sass/application.sass"
|
24
|
+
m.file "reset.sass", "public/stylesheets/sass/reset.sass"
|
25
|
+
m.file "layout.sass", "public/stylesheets/sass/layout.sass"
|
26
|
+
m.file "forms.sass", "public/stylesheets/sass/forms.sass"
|
27
|
+
m.file "tables.sass", "public/stylesheets/sass/tables.sass"
|
28
|
+
m.file "definition_lists.sass", "public/stylesheets/sass/definition_lists.sass"
|
29
|
+
end
|
30
|
+
m.file "will_paginate.rb", "config/initializers/will_paginate.rb"
|
31
|
+
m.file "required.png", "public/images/required.png"
|
32
|
+
m.file "helper.rb", "app/helpers/layout_helper.rb"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def file_name
|
37
|
+
@name.underscore
|
38
|
+
end
|
39
|
+
|
40
|
+
protected
|
41
|
+
|
42
|
+
def add_options!(opt)
|
43
|
+
opt.separator ''
|
44
|
+
opt.separator 'Options:'
|
45
|
+
opt.on("--erb", "Generate ERB for view.") { |v| options[:erb] = v }
|
46
|
+
end
|
47
|
+
|
48
|
+
def banner
|
49
|
+
<<-EOS
|
50
|
+
Creates generic layout, stylesheet, and helper files.
|
51
|
+
|
52
|
+
USAGE: #{$0} #{spec.name} [layout_name]
|
53
|
+
EOS
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
fieldset
|
2
|
+
:margin 5px
|
3
|
+
:padding 5px
|
4
|
+
:padding-top 10px
|
5
|
+
:border-top = 1px solid !primary_color
|
6
|
+
legend
|
7
|
+
:border 0 none
|
8
|
+
:padding 3px
|
9
|
+
:font
|
10
|
+
:weight bold
|
11
|
+
ol
|
12
|
+
:list-style-type none
|
13
|
+
:margin 0
|
14
|
+
:padding 0
|
15
|
+
li
|
16
|
+
:list-style-type none
|
17
|
+
:margin 0
|
18
|
+
:padding 5px
|
19
|
+
:line-height 20px
|
20
|
+
:clear left
|
21
|
+
label
|
22
|
+
:float left
|
23
|
+
:width 200px
|
24
|
+
:margin-right 16px
|
25
|
+
:position relative
|
26
|
+
abbr
|
27
|
+
:position absolute
|
28
|
+
:left 200px
|
29
|
+
:top 3px
|
30
|
+
:cursor help
|
31
|
+
:width 16px
|
32
|
+
:height 16px
|
33
|
+
:border 0 none
|
34
|
+
:background
|
35
|
+
:repeat no-repeat
|
36
|
+
:position top left
|
37
|
+
:image url('../images/required.png')
|
38
|
+
em
|
39
|
+
:visibility hidden
|
40
|
+
:display none
|
41
|
+
|
42
|
+
fieldset
|
43
|
+
:clear both
|
44
|
+
:margin 0
|
45
|
+
:padding 0
|
46
|
+
:padding-top 0
|
47
|
+
:margin-bottom -1.5em
|
48
|
+
:border 0 none
|
49
|
+
:background
|
50
|
+
:color transparent
|
51
|
+
:image none
|
52
|
+
legend
|
53
|
+
:clear both
|
54
|
+
:margin 0
|
55
|
+
:padding 0
|
56
|
+
:background
|
57
|
+
:color transparent
|
58
|
+
:color black
|
59
|
+
:font-weight normal
|
60
|
+
span
|
61
|
+
:margin 0
|
62
|
+
:padding 0
|
63
|
+
ol
|
64
|
+
:position relative
|
65
|
+
:top -1.5em
|
66
|
+
:margin 0 0 0 216px
|
67
|
+
:padding 0
|
68
|
+
li
|
69
|
+
:padding 5px 0
|
70
|
+
:margin 0
|
71
|
+
label
|
72
|
+
:float none
|
73
|
+
:width auto
|
74
|
+
:margin-right auto
|
75
|
+
|
76
|
+
.fieldWithErrors
|
77
|
+
label
|
78
|
+
:color #990000
|
79
|
+
:cursor help
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# These helper methods can be called in your template to set variables to be used in the layout
|
2
|
+
# This module should be included in all views globally,
|
3
|
+
# to do so you may need to add this line to your ApplicationController
|
4
|
+
# helper :layout
|
5
|
+
module LayoutHelper
|
6
|
+
def title(page_title, show_title = true)
|
7
|
+
@content_for_title = page_title.to_s
|
8
|
+
@show_title = show_title
|
9
|
+
end
|
10
|
+
|
11
|
+
def show_title?
|
12
|
+
@show_title
|
13
|
+
end
|
14
|
+
|
15
|
+
def stylesheet(*args)
|
16
|
+
content_for(:head) { stylesheet_link_tag(*args.map(&:to_s)) }
|
17
|
+
end
|
18
|
+
|
19
|
+
def javascript(*args)
|
20
|
+
args = args.map { |arg| arg == :defaults ? arg : arg.to_s }
|
21
|
+
content_for(:head) { javascript_include_tag(*args) }
|
22
|
+
end
|
23
|
+
|
24
|
+
def tab(identifier)
|
25
|
+
@current_tab = identifier
|
26
|
+
end
|
27
|
+
|
28
|
+
def show_tab(identifier, link = "#", link_options = {}, list_options = {})
|
29
|
+
text = t(identifier, :scope => :tabs, :default => identifier.to_s.titleize)
|
30
|
+
list_options[:class] = :current if identifier == @current_tab
|
31
|
+
content_tag(:li, link_to(text, link, link_options), list_options)
|
32
|
+
end
|
33
|
+
|
34
|
+
def cancel_link
|
35
|
+
if session[:back]
|
36
|
+
link = link_to(t(:cancel), session[:back], :confirm => h(t(:confirm_cancel)))
|
37
|
+
content_tag(:small, link, :class => "cancel")
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<title><%%= h(yield(:title) || "Untitled") %></title>
|
6
|
+
<%%= stylesheet_link_tag '<%= file_name %>' %>
|
7
|
+
<%%= yield(:head) %>
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
<div id="container">
|
11
|
+
<%%- flash.each do |name, msg| -%>
|
12
|
+
<%%= content_tag :div, msg, :id => "flash_#{name}" %>
|
13
|
+
<%%- end -%>
|
14
|
+
|
15
|
+
<%%- if show_title? -%>
|
16
|
+
<h1><%%=h yield(:title) %></h1>
|
17
|
+
<%%- end -%>
|
18
|
+
|
19
|
+
<%%= yield %>
|
20
|
+
</div>
|
21
|
+
</body>
|
22
|
+
</html>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
!!! Strict
|
2
|
+
%html{html_attrs}
|
3
|
+
|
4
|
+
%head
|
5
|
+
%title
|
6
|
+
= h(yield(:title) || t("Untitled"))
|
7
|
+
%meta{"http-equiv"=>"Content-Type", :content=>"text/html; charset=utf-8"}/
|
8
|
+
= stylesheet_link_tag 'application', :cache => true
|
9
|
+
= yield(:head)
|
10
|
+
|
11
|
+
%body
|
12
|
+
#container
|
13
|
+
#menu= render(:partial => "/shared/menu")
|
14
|
+
#body
|
15
|
+
- flash.each do |name, msg|
|
16
|
+
= content_tag :div, msg, :id => "flash_#{name}"
|
17
|
+
|
18
|
+
- if show_title?
|
19
|
+
%h1=h yield(:title)
|
20
|
+
|
21
|
+
= yield
|
22
|
+
#footer
|
23
|
+
%p
|
24
|
+
= "© #{Date.today.year}"
|
25
|
+
= render :partial => "/shared/revision" rescue nil
|
@@ -0,0 +1,121 @@
|
|
1
|
+
body
|
2
|
+
:background-color = !primary_color
|
3
|
+
:font
|
4
|
+
:family Verdana, Helvetica, Arial
|
5
|
+
:size 14px
|
6
|
+
|
7
|
+
a
|
8
|
+
:color = !secundary_color
|
9
|
+
&:hover
|
10
|
+
:color = !alternate_color
|
11
|
+
img
|
12
|
+
:border none
|
13
|
+
|
14
|
+
h1
|
15
|
+
:font
|
16
|
+
:size 30px
|
17
|
+
:weight normal
|
18
|
+
:letter-spacing 1px
|
19
|
+
:margin-bottom 10px
|
20
|
+
:color = !alternate_color
|
21
|
+
|
22
|
+
.clear
|
23
|
+
:clear both
|
24
|
+
:height 0
|
25
|
+
:overflow hidden
|
26
|
+
|
27
|
+
#container
|
28
|
+
:width 75%
|
29
|
+
:margin 0 auto
|
30
|
+
:margin-top 20px
|
31
|
+
#body
|
32
|
+
:background #fff
|
33
|
+
:padding 20px 40px
|
34
|
+
:border = solid 1px !secundary_color
|
35
|
+
:overflow visible
|
36
|
+
:clear both
|
37
|
+
#footer p
|
38
|
+
:color = !secundary_color
|
39
|
+
:text-align right
|
40
|
+
:margin-top 2px
|
41
|
+
|
42
|
+
#flash_notice,
|
43
|
+
#flash_error
|
44
|
+
:padding 5px 8px
|
45
|
+
:margin 10px 0
|
46
|
+
|
47
|
+
#flash_notice
|
48
|
+
:background-color #CFC
|
49
|
+
:border solid 1px #6C6
|
50
|
+
|
51
|
+
#flash_error
|
52
|
+
:background-color #FCC
|
53
|
+
:border solid 1px #C66
|
54
|
+
|
55
|
+
.fieldWithErrors
|
56
|
+
:display inline
|
57
|
+
|
58
|
+
#errorExplanation
|
59
|
+
:width 400px
|
60
|
+
:border 2px solid #CF0000
|
61
|
+
:padding 0
|
62
|
+
:padding-bottom 12px
|
63
|
+
:margin-bottom 20px
|
64
|
+
:background-color #f0f0f0
|
65
|
+
h2
|
66
|
+
:text-align left
|
67
|
+
:padding 5px 5px 5px 15px
|
68
|
+
:margin 0
|
69
|
+
:font
|
70
|
+
:weight bold
|
71
|
+
:size 12px
|
72
|
+
:background-color #c00
|
73
|
+
:color #fff
|
74
|
+
p
|
75
|
+
:color #333
|
76
|
+
:margin-bottom 0
|
77
|
+
:padding 8px
|
78
|
+
ul
|
79
|
+
:margin 2px 24px
|
80
|
+
li
|
81
|
+
:font-size 12px
|
82
|
+
:list-style disc
|
83
|
+
|
84
|
+
#menu
|
85
|
+
ol
|
86
|
+
:float right
|
87
|
+
:margin 0
|
88
|
+
:padding 0
|
89
|
+
li
|
90
|
+
:display inline
|
91
|
+
a
|
92
|
+
:background white
|
93
|
+
:display block
|
94
|
+
:float left
|
95
|
+
:padding 10px
|
96
|
+
:margin-left 5px
|
97
|
+
:border = 1px solid !secundary_color
|
98
|
+
:border-bottom 0 none
|
99
|
+
:margin-bottom -1px
|
100
|
+
:color black
|
101
|
+
:font
|
102
|
+
:size 16px
|
103
|
+
:weight bold
|
104
|
+
:text-decoration none
|
105
|
+
&:hover
|
106
|
+
:color #2f7282
|
107
|
+
&.current
|
108
|
+
a
|
109
|
+
:color #ff9900
|
110
|
+
|
111
|
+
ol.actions
|
112
|
+
:margin 2px 24px
|
113
|
+
li
|
114
|
+
:margin 4px 2px
|
115
|
+
:font-size 12px
|
116
|
+
:list-style circle
|
117
|
+
|
118
|
+
small.cancel
|
119
|
+
:margin-left 10px
|
120
|
+
a
|
121
|
+
:font-size 12px
|
Binary file
|
@@ -0,0 +1,39 @@
|
|
1
|
+
/* Reset from http://meyerweb.com/eric/tools/css/reset/
|
2
|
+
v1.0 | 20080212
|
3
|
+
Converted to SASS by Iain Hecker http://iain.nl/
|
4
|
+
|
5
|
+
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, defn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, legend, table, caption, tbody, tfoot, thead, tr, th, td
|
6
|
+
:margin 0
|
7
|
+
:padding 0
|
8
|
+
:border 0
|
9
|
+
:outline 0
|
10
|
+
:vertical-align baseline
|
11
|
+
:background transparent
|
12
|
+
:font
|
13
|
+
:family Verdana, Helvetica, Arial, sans-serif
|
14
|
+
:size = 14px
|
15
|
+
|
16
|
+
body
|
17
|
+
:line-height 1
|
18
|
+
|
19
|
+
ol, ul
|
20
|
+
:list-style none
|
21
|
+
|
22
|
+
blockquote, q
|
23
|
+
:quotes none
|
24
|
+
&:before, &:after
|
25
|
+
:content ''
|
26
|
+
:content none
|
27
|
+
|
28
|
+
\:focus
|
29
|
+
:outline 0
|
30
|
+
|
31
|
+
ins
|
32
|
+
:text-decoration none
|
33
|
+
|
34
|
+
del
|
35
|
+
:text-decoration line-through
|
36
|
+
|
37
|
+
table
|
38
|
+
:border-collapse collapse
|
39
|
+
:border-spacing 0
|
@@ -0,0 +1,81 @@
|
|
1
|
+
body {
|
2
|
+
background-color: #4B7399;
|
3
|
+
font-family: Verdana, Helvetica, Arial;
|
4
|
+
font-size: 14px;
|
5
|
+
}
|
6
|
+
|
7
|
+
a img {
|
8
|
+
border: none;
|
9
|
+
}
|
10
|
+
|
11
|
+
a {
|
12
|
+
color: #0000FF;
|
13
|
+
}
|
14
|
+
|
15
|
+
.clear {
|
16
|
+
clear: both;
|
17
|
+
height: 0;
|
18
|
+
overflow: hidden;
|
19
|
+
}
|
20
|
+
|
21
|
+
#container {
|
22
|
+
width: 75%;
|
23
|
+
margin: 0 auto;
|
24
|
+
background-color: #FFF;
|
25
|
+
padding: 20px 40px;
|
26
|
+
border: solid 1px black;
|
27
|
+
margin-top: 20px;
|
28
|
+
}
|
29
|
+
|
30
|
+
#flash_notice, #flash_error {
|
31
|
+
padding: 5px 8px;
|
32
|
+
margin: 10px 0;
|
33
|
+
}
|
34
|
+
|
35
|
+
#flash_notice {
|
36
|
+
background-color: #CFC;
|
37
|
+
border: solid 1px #6C6;
|
38
|
+
}
|
39
|
+
|
40
|
+
#flash_error {
|
41
|
+
background-color: #FCC;
|
42
|
+
border: solid 1px #C66;
|
43
|
+
}
|
44
|
+
|
45
|
+
.fieldWithErrors {
|
46
|
+
display: inline;
|
47
|
+
}
|
48
|
+
|
49
|
+
#errorExplanation {
|
50
|
+
width: 400px;
|
51
|
+
border: 2px solid #CF0000;
|
52
|
+
padding: 0px;
|
53
|
+
padding-bottom: 12px;
|
54
|
+
margin-bottom: 20px;
|
55
|
+
background-color: #f0f0f0;
|
56
|
+
}
|
57
|
+
|
58
|
+
#errorExplanation h2 {
|
59
|
+
text-align: left;
|
60
|
+
font-weight: bold;
|
61
|
+
padding: 5px 5px 5px 15px;
|
62
|
+
font-size: 12px;
|
63
|
+
margin: 0;
|
64
|
+
background-color: #c00;
|
65
|
+
color: #fff;
|
66
|
+
}
|
67
|
+
|
68
|
+
#errorExplanation p {
|
69
|
+
color: #333;
|
70
|
+
margin-bottom: 0;
|
71
|
+
padding: 8px;
|
72
|
+
}
|
73
|
+
|
74
|
+
#errorExplanation ul {
|
75
|
+
margin: 2px 24px;
|
76
|
+
}
|
77
|
+
|
78
|
+
#errorExplanation ul li {
|
79
|
+
font-size: 12px;
|
80
|
+
list-style: disc;
|
81
|
+
}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
!border_color = #aaa
|
2
|
+
|
3
|
+
table
|
4
|
+
:width 100%
|
5
|
+
:border-top = 3px solid !border_color
|
6
|
+
:border-bottom = 3px solid !border_color
|
7
|
+
:margin-bottom 7px
|
8
|
+
:margin-top 4px
|
9
|
+
th
|
10
|
+
:font-size 16px
|
11
|
+
td, th
|
12
|
+
:padding 7px
|
13
|
+
:vertical-align middle
|
14
|
+
:text-align left
|
15
|
+
td
|
16
|
+
:border-top = 1px solid !border_color
|
17
|
+
tbody
|
18
|
+
tr.odd
|
19
|
+
td
|
20
|
+
:background #eeeeee
|
21
|
+
tr.even
|
22
|
+
td
|
23
|
+
:background #e0e0e0
|
@@ -0,0 +1,51 @@
|
|
1
|
+
Description:
|
2
|
+
Scaffolds an entire resource, from model and migration to controller and
|
3
|
+
views. The resource is ready to use as a starting point for your restful,
|
4
|
+
resource-oriented application. Tests or specs are also generated depending
|
5
|
+
on if you have a "spec" directory or not.
|
6
|
+
|
7
|
+
IMPORTANT: This generator uses the "title" helper method which is generated
|
8
|
+
by the pizza_layout generator. You may want to run that generator first.
|
9
|
+
|
10
|
+
Usage:
|
11
|
+
Pass the name of the model, either CamelCased or under_scored, as the first
|
12
|
+
argument, and an optional list of attribute pairs and controller actions.
|
13
|
+
|
14
|
+
If no controller actions are specified, they will default to index, show,
|
15
|
+
new, create, edit, update, and destroy.
|
16
|
+
|
17
|
+
IMPORTANT: If no attribute pairs are specified, no model will be generated.
|
18
|
+
It will try to determine the attributes from an existing model.
|
19
|
+
|
20
|
+
Attribute pairs are column_name:sql_type arguments specifying the
|
21
|
+
model's attributes. Timestamps are added by default, so you don't have to
|
22
|
+
specify them by hand as 'created_at:datetime updated_at:datetime'.
|
23
|
+
|
24
|
+
For example, `pizza_scaffold post name:string content:text hidden:boolean`
|
25
|
+
gives you a model with those three attributes, a controller that handles
|
26
|
+
the create/show/update/destroy, forms to create and edit your posts, and
|
27
|
+
an index that lists them all, as well as a map.resources :posts
|
28
|
+
declaration in config/routes.rb.
|
29
|
+
|
30
|
+
Adding an "!" in the mix of arguments will invert the passed controller
|
31
|
+
actions. This will include all 7 controller actitons except the ones
|
32
|
+
mentioned. This option doesn't effect model attributes.
|
33
|
+
|
34
|
+
Examples:
|
35
|
+
script/generate pizza_scaffold post
|
36
|
+
|
37
|
+
Will create a controller called "posts" it will contain all seven
|
38
|
+
CRUD actions along with the views. A model will NOT be created,
|
39
|
+
instead it will look for an existing model and use those attributes.
|
40
|
+
|
41
|
+
script/generate pizza_scaffold post name:string content:text index new edit
|
42
|
+
|
43
|
+
Will create a Post model and migration file with the name and content
|
44
|
+
attributes. It will also create a controller with index, new, create,
|
45
|
+
edit, and update actions. Notice the create and update actions are
|
46
|
+
added automatically with new and edit.
|
47
|
+
|
48
|
+
script/generate pizza_scaffold post ! show new
|
49
|
+
|
50
|
+
Creates a posts controller (no model) with index, edit, update, and
|
51
|
+
destroy actions.
|