Show the register link everywhere it's needed #979

Contributed by Harald Klimach
This commit is contained in:
Felix Schäfer 2012-07-09 18:06:32 +02:00
parent 37c762b997
commit 12b2d3c182
2 changed files with 12 additions and 3 deletions

View File

@ -39,8 +39,8 @@
<%= render :partial => 'search/quick_search', :locals => {:search_term => @question} %> <%= render :partial => 'search/quick_search', :locals => {:search_term => @question} %>
</div> </div>
<% if User.current.logged? || !Setting.login_required? %>
<ul id="account-nav"> <ul id="account-nav">
<% if User.current.logged? || !Setting.login_required? %>
<% main_top_menu_items.each do |item| %> <% main_top_menu_items.each do |item| %>
<%= render_menu_node(item) %> <%= render_menu_node(item) %>
<% end %> <% end %>
@ -75,7 +75,8 @@
</ul> </ul>
</li> </li>
<% end %> <% end %>
<%= render_menu_node(help_menu_item) %> <%= render_menu_node(help_menu_item) %>
<% end %>
<% unless User.current.logged? %> <% unless User.current.logged? %>
<% if Setting.self_registration? %> <% if Setting.self_registration? %>
<li> <li>
@ -99,7 +100,6 @@
</li> </li>
<% end %> <% end %>
</ul> </ul>
<% end %>
</div> </div>
</div> </div>
<div id="breadcrumb"> <div id="breadcrumb">

View File

@ -101,6 +101,15 @@ class AccountTest < ActionController::IntegrationTest
assert_equal 0, Token.count assert_equal 0, Token.count
end end
def test_self_register_link_present
Setting.self_registration = '3'
Setting.login_required = '1'
get "/"
follow_redirect!
assert_select "a[href*=?]", "/account/register", :text => "Register"
end
def test_register_with_automatic_activation def test_register_with_automatic_activation
Setting.self_registration = '3' Setting.self_registration = '3'