Commit 7d11a564bf3d5d2708940fe1b8b3c8135f2707b5

Authored by Antonio Terceiro
1 parent bf9032a1

ActionItem1050: moving some features from layout to helper method

app/helpers/application_helper.rb
@@ -873,4 +873,8 @@ module ApplicationHelper @@ -873,4 +873,8 @@ module ApplicationHelper
873 stylesheet_import pngfix_stylesheet_path() 873 stylesheet_import pngfix_stylesheet_path()
874 end 874 end
875 875
  876 + def noosfero_layout_features
  877 + render :file => 'shared/noosfero_layout_features'
  878 + end
  879 +
876 end 880 end
app/models/theme.rb
@@ -64,6 +64,7 @@ class Theme @@ -64,6 +64,7 @@ class Theme
64 self.send("#{k}=", v) 64 self.send("#{k}=", v)
65 end 65 end
66 config['id'] = id 66 config['id'] = id
  67 + config['layout'] = 'application-ng'
67 end 68 end
68 69
69 def name 70 def name
app/views/layouts/application-ng.rhtml
1 -<html> 1 +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2 +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<%= html_language %>" lang="<%= html_language %>">
2 <head> 3 <head>
3 <title><%= page_title %></title> 4 <title><%= page_title %></title>
4 <%= meta_tags_for_article(@page) %> 5 <%= meta_tags_for_article(@page) %>
@@ -79,7 +80,7 @@ @@ -79,7 +80,7 @@
79 </div><!-- end id="user" --> 80 </div><!-- end id="user" -->
80 81
81 <h1 id="site-title"> 82 <h1 id="site-title">
82 - <a href="http://softwarelivre.org"><span> Title of the Site </span></a> 83 + <%= link_to content_tag('span', environment.name), environment.top_url %>
83 </h1> 84 </h1>
84 <div id="navigation"> 85 <div id="navigation">
85 <ul> 86 <ul>
@@ -101,5 +102,8 @@ @@ -101,5 +102,8 @@
101 <div id="theme-footer"> 102 <div id="theme-footer">
102 <%= theme_footer %> 103 <%= theme_footer %>
103 </div><!-- end id="theme-footer" --> 104 </div><!-- end id="theme-footer" -->
  105 +
  106 + <%= noosfero_layout_features %>
  107 +
104 </body> 108 </body>
105 </html> 109 </html>
app/views/layouts/application.rhtml
@@ -167,13 +167,9 @@ @@ -167,13 +167,9 @@
167 <% end %> 167 <% end %>
168 <%= javascript_include_tag 'better-browser-promotion' %> 168 <%= javascript_include_tag 'better-browser-promotion' %>
169 169
170 - <% if is_testing_theme %>  
171 - <%= render :file => 'shared/theme_test_panel' %>  
172 - <% end %>  
173 -  
174 - <% if ask_to_join? %>  
175 - <%= render :file => 'shared/join_community_popup' %>  
176 - <% end %> 170 + <%# if you need to add HTML stuff to the layout, include it in
  171 + app/views/shared/noosfero_layout_features.rhtml! %>
  172 + <%= noosfero_layout_features %>
177 173
178 </body> 174 </body>
179 </html> 175 </html>
app/views/shared/noosfero_layout_features.rhtml 0 → 100644
@@ -0,0 +1,7 @@ @@ -0,0 +1,7 @@
  1 + <% if is_testing_theme %>
  2 + <%= render :file => 'shared/theme_test_panel' %>
  3 + <% end %>
  4 +
  5 + <% if ask_to_join? %>
  6 + <%= render :file => 'shared/join_community_popup' %>
  7 + <% end %>