Commit 6edafc75557df3ba3db072d36f8a1ab20886635c
1 parent
75d2b5b0
Exists in
master
and in
29 other branches
asset-pipeline: fix plugins stylesheets and javascripts
Showing
1 changed file
with
5 additions
and
4 deletions
Show diff stats
app/helpers/layout_helper.rb
... | ... | @@ -28,7 +28,7 @@ module LayoutHelper |
28 | 28 | end |
29 | 29 | |
30 | 30 | def noosfero_javascript |
31 | - plugins_javascripts = @plugins.map { |plugin| [plugin.js_files].flatten.map { |js| plugin.class.public_path(js, true) } }.flatten | |
31 | + plugins_javascripts = @plugins.flat_map{ |plugin| plugin.js_files.map{ |js| plugin.class.public_path(js, true) } }.flatten | |
32 | 32 | |
33 | 33 | output = '' |
34 | 34 | output += render 'layouts/javascript' |
... | ... | @@ -43,7 +43,7 @@ module LayoutHelper |
43 | 43 | |
44 | 44 | def noosfero_stylesheets |
45 | 45 | plugins_stylesheets = @plugins.select(&:stylesheet?).map { |plugin| |
46 | - plugin.class.public_path('style.css') | |
46 | + plugin.class.public_path('style.css', true) | |
47 | 47 | } |
48 | 48 | global_css_pub = "/designs/themes/#{environment.theme}/global.css" |
49 | 49 | global_css_at_fs = Rails.root.join 'public' + global_css_pub |
... | ... | @@ -54,8 +54,9 @@ module LayoutHelper |
54 | 54 | output << stylesheet_link_tag(*icon_theme_stylesheet_path) |
55 | 55 | output << stylesheet_link_tag(jquery_ui_theme_stylesheet_path) |
56 | 56 | unless plugins_stylesheets.empty? |
57 | - cacheid = "cache/plugins-#{Digest::MD5.hexdigest plugins_stylesheets.to_s}" | |
58 | - output << stylesheet_link_tag(*plugins_stylesheets, cache: cacheid) | |
57 | + # FIXME: caching does not work with asset pipeline | |
58 | + #cacheid = "cache/plugins-#{Digest::MD5.hexdigest plugins_stylesheets.to_s}" | |
59 | + output << stylesheet_link_tag(*plugins_stylesheets) | |
59 | 60 | end |
60 | 61 | if File.exists? global_css_at_fs |
61 | 62 | output << stylesheet_link_tag(global_css_pub) | ... | ... |