Defect #5958 » 5958-patch.diff
| test/integration/layout_test.rb (working copy) | ||
|---|---|---|
|
get '/projects/ecookbook'
|
||
|
assert_select 'div#quick-search form[action=/projects/ecookbook/search]'
|
||
|
end
|
||
|
def test_sidebar_is_shown_if_content_is_present
|
||
|
log_user('admin','admin')
|
||
|
#project(1) has time_tracking enabled
|
||
|
get '/projects/ecookbook'
|
||
|
assert_select '#main.nosidebar', :count => 0
|
||
|
assert_select '#sidebar>p'
|
||
|
end
|
||
|
def test_sidebar_is_hidden_if_no_content
|
||
|
log_user('admin','admin')
|
||
|
#project(2) has time_tracking disabled,
|
||
|
#hence nothing in the sidebar
|
||
|
get '/projects/onlinestore'
|
||
|
assert_select '#main.nosidebar'
|
||
|
assert_select '#sidebar>p', :count => 0
|
||
|
end
|
||
|
end
|
||
| app/helpers/application_helper.rb (working copy) | ||
|---|---|---|
|
super sources, options
|
||
|
end
|
||
|
def content_for(name, content = nil, &block)
|
||
|
@has_content ||= {}
|
||
|
@has_content[name] = true
|
||
|
super(name, content, &block)
|
||
|
end
|
||
|
def has_content?(name)
|
||
|
(@has_content && @has_content[name]) || false
|
||
|
ActiveSupport::Deprecation.warn("ApplicationHelper#has_content? is deprecated and will be removed in Redmine 3.0. Please use #content_for? instead")
|
||
|
content_for?(name)
|
||
|
end
|
||
|
def sidebar_content?
|
||
|
has_content?(:sidebar) || view_layouts_base_sidebar_hook_response.present?
|
||
|
content_for?(:sidebar) || view_layouts_base_sidebar_hook_response.present?
|
||
|
end
|
||
|
def view_layouts_base_sidebar_hook_response
|
||
- « Previous
- 1
- 2
- 3
- Next »