diff options
author | utvk <utvk@users.noreply.github.com> | 2017-11-10 11:54:00 +0100 |
---|---|---|
committer | utvk <utvk@users.noreply.github.com> | 2017-11-10 11:54:00 +0100 |
commit | 73f4fde6655bb8c96d65614bee95557078e79ea8 (patch) | |
tree | 2ace1d200226effa93bb28ad8e5b0de6abe05516 /lib/alavetelitheme.rb | |
parent | 043445b4765e3ecf934959777f60c8ea45f9b1b6 (diff) | |
parent | 24e140ed1197776f109a2983fafc846d69f82a80 (diff) |
Merge remote-tracking branch 'upstream/master' into origin/norway3origin/norway3norway3
Diffstat (limited to 'lib/alavetelitheme.rb')
-rw-r--r-- | lib/alavetelitheme.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/alavetelitheme.rb b/lib/alavetelitheme.rb index 668d92a..c472d34 100644 --- a/lib/alavetelitheme.rb +++ b/lib/alavetelitheme.rb @@ -39,11 +39,26 @@ $alaveteli_route_extensions << 'custom-routes.rb' ['stylesheets', 'images', 'javascripts'].each do |asset_type| theme_asset_path = File.join(File.dirname(__FILE__), '..', + 'app', 'assets', asset_type) Rails.application.config.assets.paths.unshift theme_asset_path end +# Append individual theme assets to the asset path +theme_asset_path = File.join(File.dirname(__FILE__), + '..', + 'app', + 'assets') +theme_asset_path = Pathname.new(theme_asset_path).cleanpath.to_s + +LOOSE_THEME_ASSETS = lambda do |logical_path, filename| + filename.start_with?(theme_asset_path) && + !['.js', '.css', ''].include?(File.extname(logical_path)) +end + +Rails.application.config.assets.precompile.unshift(LOOSE_THEME_ASSETS) + # Tell FastGettext about the theme's translations: look in the theme's # locale-theme directory for a translation in the first place, and if # it isn't found, look in the Alaveteli locale directory next: |