diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-04-30 08:52:39 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-04-30 08:52:39 +0000 |
commit | ebe10fa6452de7ea6c5759bfd9c7b439091b54cd (patch) | |
tree | 30eb8f2f6fb758c41530597814c2e9d048fc75c8 /app/views/layouts | |
parent | 833c5035a697858cfc390b08e5db204ba30831d9 (diff) | |
download | redmine-ebe10fa6452de7ea6c5759bfd9c7b439091b54cd.tar.gz redmine-ebe10fa6452de7ea6c5759bfd9c7b439091b54cd.zip |
Added a quick search form in page header. Search functionality moved to a dedicated controller.
When used:
* outside of a project: searches projects
* inside a project: searches issues, changesets, news, documents and wiki pages of the current project
If an issue number is given, user is redirected to the corresponding issue.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@489 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views/layouts')
-rw-r--r-- | app/views/layouts/base.rhtml | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/app/views/layouts/base.rhtml b/app/views/layouts/base.rhtml index 3d6390b95..945803b0a 100644 --- a/app/views/layouts/base.rhtml +++ b/app/views/layouts/base.rhtml @@ -27,9 +27,13 @@ <h2><%= Setting.app_subtitle %></h2> </div> <div style="float: right; padding-right: 1em; padding-top: 0.2em;"> - <% if loggedin? %><small><%=l(:label_logged_as)%> <b><%= @logged_in_user.login %></b></small><% end %> + <% if loggedin? %><small><%=l(:label_logged_as)%> <strong><%= @logged_in_user.login %></strong> -</small><% end %> + <small><%= toggle_link 'Search', 'quick-search-form', :focus => 'quick-search-input' %></small> + <% form_tag({:controller => 'search', :action => 'index', :id => @project}, :method => :get, :id => 'quick-search-form', :style => "display:none;" ) do %> + <%= text_field_tag 'q', @question, :size => 15, :class => 'small', :id => 'quick-search-input' %> + <% end %> + </div> </div> - </div> <div id="navigation"> <ul> @@ -56,6 +60,12 @@ <% else %> <li class="right"><%= link_to l(:label_login), { :controller => 'account', :action => 'login' }, :class => "icon icon-user" %></li> <% end %> + + <% unless @project.nil? || @project.id.nil? %> + <li class="right" style="padding-right:0.8em;"> + </li> + <% end %> + </ul> </div> @@ -76,7 +86,7 @@ <%= link_to l(:label_document_plural), {:controller => 'projects', :action => 'list_documents', :id => @project }, :class => "menuItem" %> <%= link_to l(:label_wiki), {:controller => 'wiki', :id => @project, :page => nil }, :class => "menuItem" if @project.wiki and !@project.wiki.new_record? %> <%= link_to l(:label_attachment_plural), {:controller => 'projects', :action => 'list_files', :id => @project }, :class => "menuItem" %> - <%= link_to l(:label_search), {:controller => 'projects', :action => 'search', :id => @project }, :class => "menuItem" %> + <%= link_to l(:label_search), {:controller => 'search', :action => 'index', :id => @project }, :class => "menuItem" %> <%= link_to l(:label_repository), {:controller => 'repositories', :action => 'show', :id => @project}, :class => "menuItem" if @project.repository and !@project.repository.new_record? %> <%= link_to_if_authorized l(:label_settings), {:controller => 'projects', :action => 'settings', :id => @project }, :class => "menuItem" %> </div> @@ -100,7 +110,7 @@ <li><%= link_to l(:label_document_plural), :controller => 'projects', :action => 'list_documents', :id => @project %></li> <%= content_tag("li", link_to(l(:label_wiki), :controller => 'wiki', :id => @project, :page => nil)) if @project.wiki and !@project.wiki.new_record? %> <li><%= link_to l(:label_attachment_plural), :controller => 'projects', :action => 'list_files', :id => @project %></li> - <li><%= link_to l(:label_search), :controller => 'projects', :action => 'search', :id => @project %></li> + <li><%= link_to l(:label_search), :controller => 'search', :action => 'index', :id => @project %></li> <%= content_tag("li", link_to(l(:label_repository), :controller => 'repositories', :action => 'show', :id => @project)) if @project.repository and !@project.repository.new_record? %> <li><%= link_to_if_authorized l(:label_settings), :controller => 'projects', :action => 'settings', :id => @project %></li> </ul> |