Commit 7a71803d52ff64207adce7a94f0e7718a09ea33d

Authored by Antonio Terceiro
1 parent 2b5ae82c

Refactor stylesheet inclusion logic

app/helpers/application_helper.rb
... ... @@ -912,6 +912,15 @@ module ApplicationHelper
912 912 render :file => 'layouts/_javascript'
913 913 end
914 914  
  915 + def noosfero_stylesheets
  916 + [
  917 + 'application',
  918 + 'thickbox',
  919 + 'lightbox',
  920 + pngfix_stylesheet_path,
  921 + ]
  922 + end
  923 +
915 924 # DEPRECATED. Do not use this·
916 925 def import_controller_stylesheets(options = {})
917 926 stylesheet_import( "controller_"+ @controller.controller_name(), options )
... ...
app/views/layouts/application-ng.rhtml
... ... @@ -8,7 +8,7 @@
8 8 <meta name="description" content="<%= @environment.name %>" />
9 9 <link rel="shortcut icon" href="<%= image_path('/designs/themes/' + current_theme + '/favicon.ico') %>" type="image/x-icon" />
10 10 <%= noosfero_javascript %>
11   - <%= stylesheet_link_tag 'application', 'thickbox', 'lightbox', pngfix_stylesheet_path, :cache => 'cache' %>
  11 + <%= stylesheet_link_tag noosfero_stylesheets, :cache => 'cache' %>
12 12 <%= stylesheet_link_tag template_stylesheet_path %>
13 13 <%= stylesheet_link_tag icon_theme_stylesheet_path %>
14 14 <%= stylesheet_link_tag theme_stylesheet_path %>
... ...
app/views/layouts/application.rhtml
... ... @@ -14,7 +14,7 @@
14 14  
15 15 <%=
16 16 # Load the principal css files:
17   - stylesheet_link_tag('application', 'thickbox', 'lightbox', pngfix_stylesheet_path, :cache => 'cache') +
  17 + stylesheet_link_tag(noosfero_stylesheets, :cache => 'cache') +
18 18 stylesheet_import( %w( common help menu article button search blocks forms login-box ),
19 19 :themed_source => true ) + "\n" +
20 20 import_blocks_stylesheets(:themed_source => true) + "\n" +
... ...