calagator/calagator — pull request #44 by dhedlund (2013-07-03 07:15:34+00:00)
Title: Asset Pipeline Support (core and themes)

This branch includes full asset pipeline support for both core and theme assets. Attempts were made to keep theme changes low, but changes will be required by forks of this project using custom themes. As per theme upgrade documentation, I have included [THEME] in all commits with required or optional theme changes.

This pull request also removes some CSS associated with IE6/7 compatibility; I was not able to test these styles in the process of moving to the asset pipeline and the pipeline was choking on assets with "make this IE6 only" hacks. The target demographic using IE6 is probably non-existent for calagator.

The `themes_for_rails` was also removed as it doesn't support the asset pipeline for theme assets. The maintainer no longer wishes to support the gem (lucasefe/themes_for_rails#54), it hasn't had any commits or gem releases in over 9 months, and nobody has officially stepped up to own the it; there are some branches that attempt to add full asset pipeline support though. For our use case, the gem is overly complicated as it can be replaced just by adding a couple paths to the asset pipeline (see config/initializers/themes.rb).

For more information, see calagator/calagator#43. I went with solution 4, but did not create any theme_* asset aliases as it's easy for the forks to search for `theme_` in their themes/ directory. As part of that solution I also mentioned the possibility of including a core asset from a theme asset with the same name, but it turns out that this won't work in development mode due to the way included assets are expanded out into separate HTTP requests; the names would conflict and to work around that would require moving theme assets into a directory structure such as `themes/default/stylesheets/default/application.css`.

Calagator with the default theme should look and work the same as before. Deploying to production now requires running `assets:precompile` instead of `themes:create_cache`.