Support for Rails 3.1 asset pipeline #42

Open
wants to merge 11 commits into
from

Conversation

Projects
None yet

Since Rails 3.1 is almost out, I guess web-app-theme can be improved when using the new Rails feature, the asset pipeline. In addition to explore this new feature, changing the application theme can be easy than ever, just editing a single line in application.css file*. Thus, the application.css could be so simple as the following:

/*
 *= require 'web-app-theme'
 *= require 'web-app-theme/default'
 *= require_tree . 
 */

The first line include the web-app-theme's basic/common styles previously located in base.css file. While the second one includes all theme-specific styles.

  • Yes, nowadays we can use the theme generator passing --no-layout flag, but this command generates a bunch of files (css/images/fonts).

Nice work. My approach was more conservative :)

@rgabo rgabo and 2 others commented on an outdated diff Sep 2, 2011

app/assets/stylesheets/web-app-theme/default.css.erb
font-weight: normal;
font-style: normal;
}
body {
color: #111111;
- background: #c4c4c4 url("images/bgd.jpg");
+ background: #c4c4c4 url(<%= asset_path 'web-app-theme/default/bgd.png' %>);
@rgabo

rgabo Sep 2, 2011

@rgabo ♥ png, but we should stick to what we have ;) (it's a JPG)

@NARKOZ

NARKOZ Oct 17, 2011

@jweslley please update it with asset helpers. no need for erb.

image-url('web-app-theme/default/bgd.png')

rgabo commented Sep 8, 2011

any update on the rails 3.1-compat pull requests, @pilu? We're using this pull request. We ran into an issue with asset:precompile which is a known issue with Rails 3.1.0 official, also our configuration was generated with rc6 and some of the asset-related settings were misconfigured (cache, digest, etc). Otherwise, this pull request worked great. No wonder it is issue #42 :)

Just spotted this, looks like awesome work, can't wait to see where it goes next!

rand99 commented Oct 11, 2011

nice! i hope it s getting pulled soon

Owner

pilu commented Oct 12, 2011

hi guys, I already merged something from other forks. Pull from my master branch, check if everything is ok, and then I'll merge in your changes. Thank you!

nicolasblanco and others added some commits Jan 5, 2012

@nicolasblanco nicolasblanco Changes rails dependency to allow using web-app-theme on rails 3.2 a766647
@willthames willthames Merge remote-tracking branch 'upstream/master'
Conflicts:
	README.md
	app/assets/fonts/web-app-theme/default/museo700-regular-webfont.eot
	app/assets/fonts/web-app-theme/default/museo700-regular-webfont.svg
	app/assets/fonts/web-app-theme/default/museo700-regular-webfont.ttf
	app/assets/fonts/web-app-theme/default/museo700-regular-webfont.woff
	app/assets/fonts/web-app-theme/default/museosans_500-webfont.eot
	app/assets/fonts/web-app-theme/default/museosans_500-webfont.svg
	app/assets/fonts/web-app-theme/default/museosans_500-webfont.ttf
	app/assets/fonts/web-app-theme/default/museosans_500-webfont.woff
	app/assets/fonts/web-app-theme/default/museosans_500_italic-webfont.eot
	app/assets/fonts/web-app-theme/default/museosans_500_italic-webfont.svg
	app/assets/fonts/web-app-theme/default/museosans_500_italic-webfont.ttf
	app/assets/fonts/web-app-theme/default/museosans_500_italic-webfont.woff
	app/assets/images/web-app-theme/activo/arrow.png
	app/assets/images/web-app-theme/activo/boxbar-background.png
	app/assets/images/web-app-theme/activo/button-background-active.png
	app/assets/images/web-app-theme/activo/button-background.png
	app/assets/images/web-app-theme/activo/menubar-background.png
	app/assets/images/web-app-theme/default/arrow.png
	app/assets/images/web-app-theme/default/bgd.jpg
	app/assets/images/web-app-theme/default/boxbar-background.png
	app/assets/images/web-app-theme/default/button-background-active.png
	app/assets/images/web-app-theme/default/button-background.png
	app/assets/images/web-app-theme/default/messages/error.png
	app/assets/images/web-app-theme/default/messages/notice.png
	app/assets/images/web-app-theme/default/messages/warning.png
	app/assets/images/web-app-theme/icons/application_edit.png
	app/assets/images/web-app-theme/icons/cross.png
	app/assets/images/web-app-theme/icons/key.png
	app/assets/images/web-app-theme/icons/tick.png
	app/assets/images/web-app-theme/themes/activo/images/arrow.png
	app/assets/images/web-app-theme/themes/activo/images/boxbar-background.png
	app/assets/images/web-app-theme/themes/activo/images/button-background-active.png
	app/assets/images/web-app-theme/themes/activo/images/button-background.png
	app/assets/images/web-app-theme/themes/activo/images/menubar-background.png
	app/assets/images/web-app-theme/themes/default/images/arrow.png
	app/assets/images/web-app-theme/themes/default/images/bgd.jpg
	app/assets/images/web-app-theme/themes/default/images/boxbar-background.png
	app/assets/images/web-app-theme/themes/default/images/button-background-active.png
	app/assets/images/web-app-theme/themes/default/images/button-background.png
	app/assets/images/web-app-theme/themes/default/images/messages/error.png
	app/assets/images/web-app-theme/themes/default/images/messages/notice.png
	app/assets/images/web-app-theme/themes/default/images/messages/warning.png
	app/assets/stylesheets/web-app-theme.css
	app/assets/stylesheets/web-app-theme/activo.css.erb
	app/assets/stylesheets/web-app-theme/amro.css
	app/assets/stylesheets/web-app-theme/base.css
	app/assets/stylesheets/web-app-theme/bec-green.css
	app/assets/stylesheets/web-app-theme/bec.css
	app/assets/stylesheets/web-app-theme/blue.css
	app/assets/stylesheets/web-app-theme/default.css.erb
	app/assets/stylesheets/web-app-theme/djime-cerulean.css
	app/assets/stylesheets/web-app-theme/drastic-dark.css
	app/assets/stylesheets/web-app-theme/kathleene.css
	app/assets/stylesheets/web-app-theme/olive.css
	app/assets/stylesheets/web-app-theme/orange.css
	app/assets/stylesheets/web-app-theme/red.css
	app/assets/stylesheets/web-app-theme/reidb-greenish.css
	app/assets/stylesheets/web-app-theme/themes/activo/style.css
	app/assets/stylesheets/web-app-theme/themes/amro/style.css
	app/assets/stylesheets/web-app-theme/themes/bec-green/style.css
	app/assets/stylesheets/web-app-theme/themes/bec/style.css
	app/assets/stylesheets/web-app-theme/themes/blue/style.css
	app/assets/stylesheets/web-app-theme/themes/default/fonts/museo700-regular-webfont.eot
	app/assets/stylesheets/web-app-theme/themes/default/fonts/museo700-regular-webfont.svg
	app/assets/stylesheets/web-app-theme/themes/default/fonts/museo700-regular-webfont.ttf
	app/assets/stylesheets/web-app-theme/themes/default/fonts/museo700-regular-webfont.woff
	app/assets/stylesheets/web-app-theme/themes/default/fonts/museosans_500-webfont.eot
	app/assets/stylesheets/web-app-theme/themes/default/fonts/museosans_500-webfont.svg
	app/assets/stylesheets/web-app-theme/themes/default/fonts/museosans_500-webfont.ttf
	app/assets/stylesheets/web-app-theme/themes/default/fonts/museosans_500-webfont.woff
	app/assets/stylesheets/web-app-theme/themes/default/fonts/museosans_500_italic-webfont.eot
	app/assets/stylesheets/web-app-theme/themes/default/fonts/museosans_500_italic-webfont.svg
	app/assets/stylesheets/web-app-theme/themes/default/fonts/museosans_500_italic-webfont.ttf
	app/assets/stylesheets/web-app-theme/themes/default/fonts/museosans_500_italic-webfont.woff
	app/assets/stylesheets/web-app-theme/themes/default/style.css
	app/assets/stylesheets/web-app-theme/themes/djime-cerulean/style.css
	app/assets/stylesheets/web-app-theme/themes/drastic-dark/style.css
	app/assets/stylesheets/web-app-theme/themes/kathleene/style.css
	app/assets/stylesheets/web-app-theme/themes/olive/style.css
	app/assets/stylesheets/web-app-theme/themes/orange/style.css
	app/assets/stylesheets/web-app-theme/themes/red/style.css
	app/assets/stylesheets/web-app-theme/themes/reidb-greenish/style.css
	app/assets/stylesheets/web-app-theme/themes/warehouse/style.css
	app/assets/stylesheets/web-app-theme/warehouse.css
	images/icons/application_edit.png
	images/icons/cross.png
	images/icons/key.png
	images/icons/tick.png
	lib/generators/web_app_theme/theme/templates/layout_admin.html.erb
	lib/generators/web_app_theme/theme/templates/layout_sign.html.erb
	lib/generators/web_app_theme/theme/theme_generator.rb
	lib/web-app-theme.rb
	spec/dummy/public/images/avatar.png
	spec/dummy/public/images/icons/application_edit.png
	spec/dummy/public/images/icons/cross.png
	spec/dummy/public/images/icons/key.png
	spec/dummy/public/images/icons/tick.png
	spec/dummy/public/index.html
	spec/dummy/public/javascripts/jquery-1.3.min.js
	spec/dummy/public/javascripts/jquery.localscroll.js
	spec/dummy/public/javascripts/jquery.scrollTo.js
	stylesheets/base.css
	stylesheets/themes/activo/images/arrow.png
	stylesheets/themes/activo/images/boxbar-background.png
	stylesheets/themes/activo/images/button-background-active.png
	stylesheets/themes/activo/images/button-background.png
	stylesheets/themes/activo/images/menubar-background.png
	stylesheets/themes/activo/style.css
	stylesheets/themes/amro/style.css
	stylesheets/themes/bec-green/style.css
	stylesheets/themes/bec/style.css
	stylesheets/themes/blue/style.css
	stylesheets/themes/default/fonts/museo700-regular-webfont.eot
	stylesheets/themes/default/fonts/museo700-regular-webfont.svg
	stylesheets/themes/default/fonts/museo700-regular-webfont.ttf
	stylesheets/themes/default/fonts/museo700-regular-webfont.woff
	stylesheets/themes/default/fonts/museosans_500-webfont.eot
	stylesheets/themes/default/fonts/museosans_500-webfont.svg
	stylesheets/themes/default/fonts/museosans_500-webfont.ttf
	stylesheets/themes/default/fonts/museosans_500-webfont.woff
	stylesheets/themes/default/fonts/museosans_500_italic-webfont.eot
	stylesheets/themes/default/fonts/museosans_500_italic-webfont.svg
	stylesheets/themes/default/fonts/museosans_500_italic-webfont.ttf
	stylesheets/themes/default/fonts/museosans_500_italic-webfont.woff
	stylesheets/themes/default/images/arrow.png
	stylesheets/themes/default/images/bgd.jpg
	stylesheets/themes/default/images/boxbar-background.png
	stylesheets/themes/default/images/button-background-active.png
	stylesheets/themes/default/images/button-background.png
	stylesheets/themes/default/images/messages/error.png
	stylesheets/themes/default/images/messages/notice.png
	stylesheets/themes/default/images/messages/warning.png
	stylesheets/themes/default/style.css
	stylesheets/themes/djime-cerulean/style.css
	stylesheets/themes/drastic-dark/style.css
	stylesheets/themes/kathleene/style.css
	stylesheets/themes/olive/style.css
	stylesheets/themes/orange/style.css
	stylesheets/themes/red/style.css
	stylesheets/themes/reidb-greenish/style.css
	stylesheets/themes/warehouse/style.css
	web-app-theme.gemspec
0ef0e31
@willthames willthames Merge remote-tracking branch 'rails-3.2/master' 1c7c75e
@willthames willthames Removed some files introduced by merging back with master that should
have remained removed
27c7781

I've attempted to merge pilu/master back into jweslley/master.
git@github.com:willthames/web-app-theme.git

Looking at the network graph it doesn't seem to reflect how the branches do come together, however - I may have made a git mistake somewhere (perhaps I should have merged the other way around).

I'm not clear how assets are generated now, since the web-app-theme/assets generator no longer exists.

Otherwise my fork reflects most of pilu/master's recent history and works with 3.2 as per slainer68's fix in #49.

@jweslley jweslley Merge pull request #1 from willthames/master
Merge of pilu/master and jweslley/master
4e79614
Owner

pilu commented Feb 8, 2012

hi guys, I can't automatically merge this request, maybe some conflicts. if you try to rebase or fix that I'll merge it asap, thank you!

Please merge one of the asset pipeline compatible pull requests so that we can use web-app-theme with rails 3.2...

Owner

pilu commented Mar 20, 2012

Hi, if you guys can manage this now I can give you write access to the repository. Let me know if you can, thank you!

sheam commented Jul 3, 2012

Is there a way I can use this pull in my rails 3.2 project? What line do I need in my gem file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment