ChiliProject is not maintained anymore. Please be advised that there will be no more updates.
We do not recommend that you setup new ChiliProject instances and we urge all existing users to migrate their data to a maintained system, e.g. Redmine. We will provide a migration script later. In the meantime, you can use the instructions by Christian Daehn.
Register / Login not available if authentication required (Bug #979)
Description
The account-nav is not visible at all, if the authentication is required.
However it is needed to provide a link to the self-registration. The following
patch seems to address this problem (and deactivates the search for not logged in users, if authentication is required):
diff --git a/app/views/layouts/base.rhtml b/app/views/layouts/base.rhtml index b490262..258c58e 100644 --- a/app/views/layouts/base.rhtml +++ b/app/views/layouts/base.rhtml @@ -34,12 +34,14 @@ <div id="header"> <div id="logo"><%= link_to(h(Setting.app_title), home_path) %></div> <div id="top-menu-items"> + <% if User.current.logged? || !Setting.login_required? %> <div id="search"> <%= render :partial => 'search/quick_search', :locals => {:search_term => @question} %> - </div> + </div> + <% end %> - <% if User.current.logged? || !Setting.login_required? %> <ul id="account-nav"> + <% if User.current.logged? || !Setting.login_required? %> <% main_top_menu_items.each do |item| %> <%= render_menu_node(item) %> <% end %> @@ -74,7 +76,8 @@ </ul> </li> <% end %> - <%= render_menu_node(help_menu_item) %> + <%= render_menu_node(help_menu_item) %> + <% end %> <% unless User.current.logged? %> <% if Setting.self_registration? %> <li> @@ -98,7 +101,6 @@ </li> <% end %> </ul> - <% end %> </div> </div> <div id="breadcrumb">
Associated revisions
Show the register link everywhere it's needed #979
Contributed by Harald Klimach
Don't show the search field when it's not needed #979
Contributed by Harald Klimach
History
Updated by Harald Klimach at 2012-05-02 08:58 pm
Any chance for inclusion of this patch, or comment on its invalidity? Thanks.
Updated by Harald Klimach at 2012-06-10 01:27 am
Sad, you couldn't consider this for the 3.2.
I would appreciate any feedback, what's wrong with this change.
Updated by Felix Schäfer at 2012-07-09 04:26 pm
To be honest I fear we totally missed it, sorry. I'll see about including it in 3.3.
- Status changed from Open to Ready for review
- Assignee set to Felix Schäfer
- Target version set to 3.3.0
Updated by Harald Klimach at 2012-07-09 04:37 pm
Thanks a lot.
I just wanted to know if this is the "right" way to fix the issue ;)
Updated by Felix Schäfer at 2012-07-09 04:41 pm
Harald Klimach wrote:
I just wanted to know if this is the "right" way to fix the issue ;)
Seems OK from a first look, I'll do a little log-diving to see where this got lost and see if we can add tests for it before committing it though (or if you want to have a crack at the tests: be my guest ;-) )
Updated by Felix Schäfer at 2012-07-09 06:12 pm
- Status changed from Ready for review to Closed
- Assignee deleted (
Felix Schäfer)