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