use static by default
[opensuse:software-o-o.git] / app / helpers / application_helper.rb
1 # Methods added to this helper will be available to all templates in the application.
2 module ApplicationHelper
3
4   @@theme_prefix = nil
5
6   def theme_prefix
7     return @@theme_prefix if @@theme_prefix
8     @@theme_prefix = '/themes'
9     @@theme_prefix
10   end
11
12   def compute_asset_host(source)
13     if USE_STATIC and source.slice(0, theme_prefix.length) == theme_prefix
14       return "https://static.opensuse.org"
15     end
16     super(source)
17   end
18
19 end