Commit fa8d45fc1ec3b635c8d14465b8ef036274667598
1 parent
7621915d
Exists in
master
and in
29 other branches
Include javascript from theme in NG layout
(ActionItem1500)
Showing
2 changed files
with
10 additions
and
0 deletions
Show diff stats
app/helpers/application_helper.rb
@@ -643,6 +643,15 @@ module ApplicationHelper | @@ -643,6 +643,15 @@ module ApplicationHelper | ||
643 | html.join "\n" | 643 | html.join "\n" |
644 | end | 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 | def file_field_or_thumbnail(label, image, i) | 655 | def file_field_or_thumbnail(label, image, i) |
647 | display_form_field label, ( | 656 | display_form_field label, ( |
648 | render :partial => (image && image.valid? ? 'shared/show_thumbnail' : 'shared/change_image'), | 657 | render :partial => (image && image.valid? ? 'shared/show_thumbnail' : 'shared/change_image'), |
app/views/layouts/application-ng.rhtml
@@ -90,5 +90,6 @@ | @@ -90,5 +90,6 @@ | ||
90 | <%= theme_footer %> | 90 | <%= theme_footer %> |
91 | </div><!-- end id="theme-footer" --> | 91 | </div><!-- end id="theme-footer" --> |
92 | <%= noosfero_layout_features %> | 92 | <%= noosfero_layout_features %> |
93 | + <%= theme_javascript_ng %> | ||
93 | </body> | 94 | </body> |
94 | </html> | 95 | </html> |