Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V3.1.0 - Updated to use the rails 3.1 assets pipeline #41

Closed
wants to merge 12 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -8,5 +8,6 @@ pkg/*
tmp/*
spec/dummy/tmp/*
spec/dummy/log/*
spec/dummy/app/assets/*
pkg
web-app-theme-*.gem
159 changes: 159 additions & 0 deletions Gemfile.lock
@@ -0,0 +1,159 @@
PATH
remote: .
specs:
web-app-theme (0.8.0)
rails (~> 3.1.0)
thor (~> 0.14)
thor (~> 0.14)

GEM
remote: http://rubygems.org/
specs:
actionmailer (3.1.1)
actionpack (= 3.1.1)
mail (~> 2.3.0)
actionpack (3.1.1)
activemodel (= 3.1.1)
activesupport (= 3.1.1)
builder (~> 3.0.0)
erubis (~> 2.7.0)
i18n (~> 0.6)
rack (~> 1.3.2)
rack-cache (~> 1.1)
rack-mount (~> 0.8.2)
rack-test (~> 0.6.1)
sprockets (~> 2.0.2)
activemodel (3.1.1)
activesupport (= 3.1.1)
builder (~> 3.0.0)
i18n (~> 0.6)
activerecord (3.1.1)
activemodel (= 3.1.1)
activesupport (= 3.1.1)
arel (~> 2.2.1)
tzinfo (~> 0.3.29)
activeresource (3.1.1)
activemodel (= 3.1.1)
activesupport (= 3.1.1)
activesupport (3.1.1)
multi_json (~> 1.0)
arel (2.2.1)
aruba (0.4.6)
bcat (>= 0.6.1)
childprocess (>= 0.2.0)
cucumber (>= 1.0.2)
rdiscount (>= 1.6.8)
rspec (>= 2.6.0)
bcat (0.6.2)
rack (~> 1.0)
builder (3.0.0)
capybara (1.1.1)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
selenium-webdriver (~> 2.0)
xpath (~> 0.1.4)
childprocess (0.2.2)
ffi (~> 1.0.6)
cucumber (1.1.0)
builder (>= 2.1.2)
diff-lcs (>= 1.1.2)
gherkin (~> 2.5.0)
json (>= 1.4.6)
term-ansicolor (>= 1.0.6)
cucumber-rails (1.1.1)
capybara (>= 1.1.1)
cucumber (>= 1.1.0)
nokogiri (>= 1.5.0)
diff-lcs (1.1.3)
erubis (2.7.0)
ffi (1.0.9)
gherkin (2.5.1)
json (>= 1.4.6)
hike (1.2.1)
i18n (0.6.0)
json (1.6.1)
json_pure (1.6.1)
mail (2.3.0)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.16)
multi_json (1.0.3)
nokogiri (1.5.0)
polyglot (0.3.2)
rack (1.3.4)
rack-cache (1.1)
rack (>= 0.4)
rack-mount (0.8.3)
rack (>= 1.0.0)
rack-ssl (1.3.2)
rack
rack-test (0.6.1)
rack (>= 1.0)
rails (3.1.1)
actionmailer (= 3.1.1)
actionpack (= 3.1.1)
activerecord (= 3.1.1)
activeresource (= 3.1.1)
activesupport (= 3.1.1)
bundler (~> 1.0)
railties (= 3.1.1)
railties (3.1.1)
actionpack (= 3.1.1)
activesupport (= 3.1.1)
rack-ssl (~> 1.3.2)
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (~> 0.14.6)
rake (0.9.2)
rdiscount (1.6.8)
rdoc (3.10)
json (~> 1.4)
rspec (2.6.0)
rspec-core (~> 2.6.0)
rspec-expectations (~> 2.6.0)
rspec-mocks (~> 2.6.0)
rspec-core (2.6.4)
rspec-expectations (2.6.0)
diff-lcs (~> 1.1.2)
rspec-mocks (2.6.0)
rspec-rails (2.6.1)
actionpack (~> 3.0)
activesupport (~> 3.0)
railties (~> 3.0)
rspec (~> 2.6.0)
rubyzip (0.9.4)
selenium-webdriver (2.8.0)
childprocess (>= 0.2.1)
ffi (>= 1.0.7)
json_pure
rubyzip
sprockets (2.0.2)
hike (~> 1.2)
rack (~> 1.0)
tilt (!= 1.3.0, ~> 1.1)
sqlite3 (1.3.4)
term-ansicolor (1.0.6)
thor (0.14.6)
tilt (1.3.3)
treetop (1.4.10)
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.30)
xpath (0.1.4)
nokogiri (~> 1.3)

PLATFORMS
ruby

DEPENDENCIES
aruba
bundler (~> 1.0.0)
cucumber
cucumber-rails
rspec
rspec-rails
sqlite3
web-app-theme!
16 changes: 8 additions & 8 deletions README.md
Expand Up @@ -60,7 +60,7 @@ If you want to generate the stylesheets of a specific theme without changing the
You can specify the text used in the header with the `--app-name` option:

rails g web_app_theme:theme --app-name="My New Application"

If you need a layout for login and signup pages, you can use the `--type` option with `sign` as value. Ìf not specified, the default value is `administration`

rails g web_app_theme:theme sign --layout-type=sign
Expand All @@ -70,8 +70,8 @@ If you need a layout for login and signup pages, you can use the `--type` option
### Assets Generator

Used to copy a theme of your choice from the gem to your application, without parameters it will copy the 'default' theme
rails g web_app_theme:assets --theme=red

rails g web_app_theme:assets --theme=red

This will copy the theme files on your app/assets/stylesheets/web-app-theme path.
Also this will copy theme's images to app/assets/images/web-app-theme path
Expand All @@ -85,7 +85,7 @@ Start creating your controllers manually or with a scaffold, and then use the `t
If you have a controller named like the plural of the used model you can specify just the first parameter:

rails g web_app_theme:themed posts # you have a model named Post and a controller named PostsController

rails g web_app_theme:themed admin/gallery_pictures # you have a model named GalleryPicture and a controller named Admin::GalleryPicturesController

Use the `--layout` option specifying the previously generated layout to add a link to the controller you are working on:
Expand All @@ -95,7 +95,7 @@ Use the `--layout` option specifying the previously generated layout to add a li
If the controller has a name different to the model used, specify the controller path in the first parameter and the model name in the second one:

rails g web_app_theme:themed items post

rails g web_app_theme:themed admin/items post

If you use `will_paginate` for pagination use the `--will-paginate`:
Expand All @@ -107,12 +107,12 @@ You can specify the template engine with `--engine=name` option, where name can
rails g web_app_theme:themed posts --engine=haml

If you have something like `map.resource :dashboard` in your `routes.rb` file, you can use the `--type=text` to generate a view with just text:

rails g web_app_theme:themed dashboards --themed-type=text

If you want to show form error messages inside the generated forms, use the following code inside your `environment.rb`

ActionView::Base.field_error_proc = Proc.new do |html_tag, instance|
ActionView::Base.field_error_proc = Proc.new do |html_tag, instance|
if html_tag =~ /<label/
%|<div class="fieldWithErrors">#{html_tag} <span class="error">#{[instance.error_message].join(', ')}</span></div>|.html_safe
else
Expand All @@ -123,7 +123,7 @@ If you want to show form error messages inside the generated forms, use the foll
If you want to have translated pages, simple create in your locale.yml the keys just like config/locales/en_us.yml example.

en_us:
web-app-theme:
web-app-theme:
save: Save
cancel: Cancel
list: List
Expand Down
Expand Up @@ -45,7 +45,7 @@ hr {
color: #e2e2e2;
}

#header {
#header {
background: #002134;
}

Expand Down Expand Up @@ -153,7 +153,7 @@ hr {
#sidebar ul li {
background-position: 15px 11px;
background-repeat: no-repeat;
background-image: url("/web-app-theme/themes/activo/images/arrow.png");
background-image: url("<%= asset_path("web-app-theme/themes/activo/images/arrow.png") %>");
border-bottom: 1px solid #e2e2e2;
}

Expand All @@ -168,7 +168,7 @@ hr {

#main-navigation {
background-color: #f4f4f4;
background-image: url("/web-app-theme/themes/activo/images/menubar-background.png");
background-image: url("<%= asset_path("web-app-theme/themes/activo/images/menubar-background.png") %>");
background-repeat: repeat-x;
}

Expand All @@ -193,7 +193,7 @@ hr {
background-color: #f2f1ee;
border-bottom: none;
border-bottom-width: 5px;
background-image: url("/web-app-theme/themes/activo/images/boxbar-background.png");
background-image: url("<%= asset_path("web-app-theme/themes/activo/images/boxbar-background.png") %>");
}

.secondary-navigation ul li.active, .secondary-navigation ul li.active a:hover {
Expand All @@ -219,7 +219,7 @@ hr {

.pagination a, .pagination span {
background-color: #f4f4f4;
background-image: url("/web-app-theme/themes/activo/images/button-background.png");
background-image: url("<%= asset_path("web-app-theme/themes/activo/images/button-background.png") %>");
color: #111;
text-align: center;
min-width: 15px;
Expand All @@ -246,7 +246,7 @@ hr {
}

.pagination a:active {
background-image: url("/web-app-theme/themes/activo/images/button-background-active.png");
background-image: url("<%= asset_path("web-app-theme/themes/activo/images/button-background-active.png") %>");
outline: none;
}

Expand Down Expand Up @@ -316,7 +316,7 @@ hr {

a.button, button.button {
background-color: #f4f4f4;
background-image: url("/web-app-theme/themes/activo/images/button-background.png");
background-image: url("<%= asset_path("web-app-theme/themes/activo/images/button-background.png") %>");
border: 1px solid #c3c4ba;
font-family: helvetica, arial, sans-serif;
font-weight: normal;
Expand All @@ -338,7 +338,7 @@ a.button:hover, button.button:hover {
a.button:active, button.button:active {
outline: none;
background-color: #ddd;
background-image: url("/web-app-theme/themes/activo/images/button-background-active.png");
background-image: url("<%= asset_path("web-app-theme/themes/activo/images/button-background-active.png") %>");
}

/* flash-messages */
Expand Down
Expand Up @@ -4,11 +4,11 @@ h1, h2, h3 {color:#444}
body {
color: #222;
background: #e5e5e5;
font-family: "Bitstream Vera Sans", verdana, sans-serif;
font-family: "Bitstream Vera Sans", verdana, sans-serif;
}

hr {
background: #f0f0ee;
background: #f0f0ee;
}

p {
Expand Down Expand Up @@ -96,7 +96,7 @@ input.checkbox {
}


#sidebar h3 {
#sidebar h3 {
background: #c7d8d8;
border-bottom:1px solid #999;
padding: 5px 10px;
Expand Down Expand Up @@ -204,7 +204,7 @@ input.checkbox {
display: block;
width: 12px;
height: 12px;
background: transparent url('/web-app-theme/themes/bec-green/images/tick.png') center no-repeat;
background: transparent url("<%= asset_path('web-app-theme/themes/bec-green/images/tick.png') %>") center no-repeat;
text-indent: -9999px;
-moz-outline: none;
}
Expand Down Expand Up @@ -281,10 +281,10 @@ ul.list li .left {
/* box */

#box .block {
background: #FFF;
background: #FFF;
}

#box .block h2 {
background: #48625B;
background: #48625B;
color: #FFF;
}
Expand Up @@ -4,11 +4,11 @@ h1, h2, h3 {color:#444}
body {
color: #333;
background: #e5e5e5;
font-family: Verdana, Arial, "Bitstream Vera Sans", sans-serif;
font-family: Verdana, Arial, "Bitstream Vera Sans", sans-serif;
}

hr {
background: #f0f0ee;
background: #f0f0ee;
}

p {
Expand Down Expand Up @@ -101,7 +101,7 @@ input.checkbox {
}


#sidebar h3 {
#sidebar h3 {
background: #c7d8d8;
border-bottom:1px solid #999;
padding: 5px 10px;
Expand Down Expand Up @@ -210,7 +210,7 @@ input.checkbox {
display: block;
width: 12px;
height: 12px;
background: transparent url('/web-app-theme/themes/bec/images/tick.png') center no-repeat;
background: transparent url("<%= asset_path('web-app-theme/themes/bec/images/tick.png') %>") center no-repeat;
text-indent: -9999px;
-moz-outline: none;
}
Expand Down Expand Up @@ -292,10 +292,10 @@ ul.list li .left {
/* box */

#box .block {
background: #FFF;
background: #FFF;
}

#box .block h2 {
background: #006666;
background: #006666;
color: #FFF;
}