ChiliProject is not maintained anymore. Please be advised that there will be no more updates.
We do not recommend that you setup new ChiliProject instances and we urge all existing users to migrate their data to a maintained system, e.g. Redmine. We will provide a migration script later. In the meantime, you can use the instructions by Christian Daehn.
Support themes outside of the public/themes path (Bug #993)
Description
The themes_storage_path
documentation makes it appear that themes can be located outside of the public/themes
path but I found that doesn't work at all. Redmine::Themes
has two methods that hardcode the css and js to "/themes/THEME_NAME/".
I've attached a patch that allows themes to be located anywhere within the public/
directory. I'm successfully using this to bundle a theme within a plugin (e.g. plugin comes with a theme that is added to the list of available themes).
No pull request because I can't apply this to master yet (deep into another branch) and because I haven't written tests for it.
Tech details¶
This changes a Theme so it uses a new public_path
for it's CSS and JS. The public_path is set by using the Theme's path (absolute filesystem path in initialize) and removing the Rails public path from it. So it converts the default core theme like so:
- "path" /home/edavis/dev/chiliproject/public/themes/default
- "public_path" /themes/default
- "javascript_path" /themes/default/javascripts...
which is how it is currently hardcoded. For my bundled theme it works using Engine's public/plugin_assets like so:
- "path" /home/edavis/dev/chiliproject/public/plugin_assets/redmine_shane_and_peter_design/themes/modern_tribe
- "public_path" /plugin_assets/redmine_shane_and_peter_design/themes/modern_tribe
- "javascript_path" /plugin_assets/redmine_shane_and_peter_design/themes/modern_tribe/javascripts
(I'd be happy to show how I've bundled a theme inside of a plugin as soon as I'm complete)
Associated revisions
- report can be done using days as columns (#993)
- add a total column to the time report
- replace upper-right links by tabs to switch between details and report
- preserve date range filter when switching between details and report
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1326 e93f8b46-1217-0410-a6f0-8f06a7374b81
History
Updated by Holger Just at 2012-04-16 06:13 pm
In fact, themes can be located outside of public/themes
today. However, it requires an Alias
in the frontend webserver. Something like this works just fine today:
# In the Apache vhost Alias /themes /my/theme/path
# In configuration.yml themes_storage_path: "/my/theme/path"
That said, I support the usecase of allowing to ship a theme as a plugin. The current facility doesn't really support that (it does, but it requires more manual steps than it's worth). Allowing plugins to ship themes unifies extensions and overall makes things easier. Once we moved to Rails 3 (with its asset pipeline), this will be the only way for shipping themes anyway as I'd like to handle any extension with gems and (simple) engines.