Commit fa8d45fc1ec3b635c8d14465b8ef036274667598

Authored by Antonio Terceiro
1 parent 7621915d

Include javascript from theme in NG layout

(ActionItem1500)
app/helpers/application_helper.rb
... ... @@ -643,6 +643,15 @@ module ApplicationHelper
643 643 html.join "\n"
644 644 end
645 645  
  646 + def theme_javascript_ng
  647 + script = File.join(theme_path, 'theme.js')
  648 + if File.exists?(File.join(Rails.root, 'public', script))
  649 + javascript_include_tag script
  650 + else
  651 + nil
  652 + end
  653 + end
  654 +
646 655 def file_field_or_thumbnail(label, image, i)
647 656 display_form_field label, (
648 657 render :partial => (image && image.valid? ? 'shared/show_thumbnail' : 'shared/change_image'),
... ...
app/views/layouts/application-ng.rhtml
... ... @@ -90,5 +90,6 @@
90 90 <%= theme_footer %>
91 91 </div><!-- end id="theme-footer" -->
92 92 <%= noosfero_layout_features %>
  93 + <%= theme_javascript_ng %>
93 94 </body>
94 95 </html>
... ...