diff options
author | José Valim <jose.valim@gmail.com> | 2009-07-01 21:23:30 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2009-07-02 10:27:40 +0200 |
commit | a7c1591315b49e94798d6d51446cbc4139463140 (patch) | |
tree | 983212f5a306d88e8d3ec227bdf7ec0e23d8dcc5 /railties/lib/generators/rails/stylesheets | |
parent | 7f7afdf0f11b6748ace1ee48f8d604637058001e (diff) | |
download | rails-a7c1591315b49e94798d6d51446cbc4139463140.tar.gz rails-a7c1591315b49e94798d6d51446cbc4139463140.tar.bz2 rails-a7c1591315b49e94798d6d51446cbc4139463140.zip |
Added stylesheets controller which is invoked by scaffold.
Diffstat (limited to 'railties/lib/generators/rails/stylesheets')
3 files changed, 68 insertions, 0 deletions
diff --git a/railties/lib/generators/rails/stylesheets/USAGE b/railties/lib/generators/rails/stylesheets/USAGE new file mode 100644 index 0000000000..d6a81e51d0 --- /dev/null +++ b/railties/lib/generators/rails/stylesheets/USAGE @@ -0,0 +1,5 @@ +Description: + Copies scaffold stylesheets to public/stylesheets/. + +Examples: + `./script/generate stylesheets` diff --git a/railties/lib/generators/rails/stylesheets/stylesheets_generator.rb b/railties/lib/generators/rails/stylesheets/stylesheets_generator.rb new file mode 100644 index 0000000000..256b9a208f --- /dev/null +++ b/railties/lib/generators/rails/stylesheets/stylesheets_generator.rb @@ -0,0 +1,9 @@ +module Rails + module Generators + class StylesheetsGenerator < Base + def copy_stylesheets_file + copy_file "scaffold.css", "public/stylesheets/scaffold.css" + end + end + end +end diff --git a/railties/lib/generators/rails/stylesheets/templates/scaffold.css b/railties/lib/generators/rails/stylesheets/templates/scaffold.css new file mode 100644 index 0000000000..093c20994d --- /dev/null +++ b/railties/lib/generators/rails/stylesheets/templates/scaffold.css @@ -0,0 +1,54 @@ +body { background-color: #fff; color: #333; } + +body, p, ol, ul, td { + font-family: verdana, arial, helvetica, sans-serif; + font-size: 13px; + line-height: 18px; +} + +pre { + background-color: #eee; + padding: 10px; + font-size: 11px; +} + +a { color: #000; } +a:visited { color: #666; } +a:hover { color: #fff; background-color:#000; } + +.fieldWithErrors { + padding: 2px; + background-color: red; + display: table; +} + +#errorExplanation { + width: 400px; + border: 2px solid red; + padding: 7px; + padding-bottom: 12px; + margin-bottom: 20px; + background-color: #f0f0f0; +} + +#errorExplanation h2 { + text-align: left; + font-weight: bold; + padding: 5px 5px 5px 15px; + font-size: 12px; + margin: -7px; + background-color: #c00; + color: #fff; +} + +#errorExplanation p { + color: #333; + margin-bottom: 0; + padding: 5px; +} + +#errorExplanation ul li { + font-size: 12px; + list-style: square; +} + |