From f025f5c05852c6a847349c47ebbd2f1182181182 Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Thu, 14 Sep 2017 17:20:30 +0100 Subject: Add extra theme assets to the asset path The new version of Sprockets for Rails 4.2 only adds assets from the base path so we need to add this ourselves. https://github.com/rails/sprockets-rails/blob/v3.2.0/lib/sprockets/railtie.rb#L84-L87 --- lib/alavetelitheme.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'lib') diff --git a/lib/alavetelitheme.rb b/lib/alavetelitheme.rb index 0658142..c472d34 100644 --- a/lib/alavetelitheme.rb +++ b/lib/alavetelitheme.rb @@ -45,6 +45,20 @@ $alaveteli_route_extensions << 'custom-routes.rb' 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: -- cgit v1.2.3 From b258236ee3f3ebf191a33994235bed8f84a6c291 Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Thu, 21 Sep 2017 16:15:27 +0100 Subject: Use HTTP methods for custom routes --- lib/config/custom-routes.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/config/custom-routes.rb b/lib/config/custom-routes.rb index 98fccf7..efbf95e 100644 --- a/lib/config/custom-routes.rb +++ b/lib/config/custom-routes.rb @@ -3,7 +3,7 @@ Rails.application.routes.draw do # brand new controller example - # match '/mycontroller' => 'general#mycontroller' + # get '/mycontroller' => 'general#mycontroller' # Additional help page example - # match '/help/help_out' => 'help#help_out' + # get '/help/help_out' => 'help#help_out' end -- cgit v1.2.3 From 043970acf94b7f1e8cfbde7c2bfd6ebafb8096c0 Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Fri, 22 Sep 2017 16:46:19 +0100 Subject: Remove obsolete partial No longer needed after core commit d80e0ec0bc2bf81a0714cd44750da46faad44c06 --- lib/views/general/_orglink.html.erb | 1 - 1 file changed, 1 deletion(-) delete mode 100644 lib/views/general/_orglink.html.erb (limited to 'lib') diff --git a/lib/views/general/_orglink.html.erb b/lib/views/general/_orglink.html.erb deleted file mode 100644 index b22d123..0000000 --- a/lib/views/general/_orglink.html.erb +++ /dev/null @@ -1 +0,0 @@ -<%= link_to image_tag('old-logo.png', :alt => 'Alaveteli logo'), frontpage_url, :id=>'logo' %> -- cgit v1.2.3