@@ -1173,18 +1173,13 module ApplicationHelper | |||||
1173 | super sources, options |
|
1173 | super sources, options | |
1174 | end |
|
1174 | end | |
1175 |
|
1175 | |||
1176 | def content_for(name, content = nil, &block) |
|
1176 | # TODO: remove this in 2.5.0 | |
1177 | @has_content ||= {} |
|
|||
1178 | @has_content[name] = true |
|
|||
1179 | super(name, content, &block) |
|
|||
1180 | end |
|
|||
1181 |
|
||||
1182 | def has_content?(name) |
|
1177 | def has_content?(name) | |
1183 | (@has_content && @has_content[name]) || false |
|
1178 | content_for?(name) | |
1184 | end |
|
1179 | end | |
1185 |
|
1180 | |||
1186 | def sidebar_content? |
|
1181 | def sidebar_content? | |
1187 |
|
|
1182 | content_for?(:sidebar) || view_layouts_base_sidebar_hook_response.present? | |
1188 | end |
|
1183 | end | |
1189 |
|
1184 | |||
1190 | def view_layouts_base_sidebar_hook_response |
|
1185 | def view_layouts_base_sidebar_hook_response |
@@ -320,6 +320,16 class ProjectsControllerTest < ActionController::TestCase | |||||
320 | assert_select 'li', :text => /Development status/ |
|
320 | assert_select 'li', :text => /Development status/ | |
321 | end |
|
321 | end | |
322 |
|
322 | |||
|
323 | def test_show_should_not_display_empty_sidebar | |||
|
324 | p = Project.find(1) | |||
|
325 | p.enabled_module_names = [] | |||
|
326 | p.save! | |||
|
327 | ||||
|
328 | get :show, :id => 'ecookbook' | |||
|
329 | assert_response :success | |||
|
330 | assert_select '#main.nosidebar' | |||
|
331 | end | |||
|
332 | ||||
323 | def test_show_should_not_display_hidden_custom_fields |
|
333 | def test_show_should_not_display_hidden_custom_fields | |
324 | ProjectCustomField.find_by_name('Development status').update_attribute :visible, false |
|
334 | ProjectCustomField.find_by_name('Development status').update_attribute :visible, false | |
325 | get :show, :id => 'ecookbook' |
|
335 | get :show, :id => 'ecookbook' |
General Comments 0
You need to be logged in to leave comments.
Login now