3715-2.patch

Lucas Panjer, 2009-09-09 10:03

Download (1.65 KB)

View differences:

test/integration/lib/redmine/menu_manager_test.rb (working copy)
67 67
      end
68 68
    end
69 69
  end
70

  
71
  def test_top_menu_and_search_not_visible_when_login_required
72
    Setting.login_required = 1
73

  
74
    get '/'
75

  
76
    # top-menu div should not have child ul elements
77
    assert_select "#top-menu > ul", 0
78

  
79
    # quick-search div should not exist
80
    assert_select "#quick-search", 0
81
  end
70 82
end
app/views/layouts/base.rhtml (working copy)
25 25
        <%= render_menu :account_menu -%>
26 26
    </div>
27 27
    <%= content_tag('div', "#{l(:label_logged_as)} #{link_to_user(User.current, :format => :username)}", :id => 'loggedas') if User.current.logged? %>
28
    <%= render_menu :top_menu -%>
28
    <%= render_menu :top_menu if User.current.logged? || !Setting.login_required? -%>
29 29
</div>
30 30
      
31 31
<div id="header">
32
    <% if User.current.logged? || !Setting.login_required? %>
32 33
    <div id="quick-search">
33 34
        <% form_tag({:controller => 'search', :action => 'index', :id => @project}, :method => :get ) do %>
34 35
        <%= link_to l(:label_search), {:controller => 'search', :action => 'index', :id => @project}, :accesskey => accesskey(:search) %>:
......
36 37
        <% end %>
37 38
        <%= render_project_jump_box %>
38 39
    </div>
40
    <% end %>
39 41
    
40 42
    <h1><%= page_header_title %></h1>
41 43