comparison app/helpers/.svn/text-base/search_helper.rb.svn-base @ 507:0c939c159af4 redmine-1.2

Update to Redmine 1.2.1 on 1.2-stable branch (Redmine SVN rev 6270)
author Chris Cannam
date Thu, 14 Jul 2011 10:32:19 +0100
parents 94944d00e43c
children
comparison
equal deleted inserted replaced
441:cbce1fd3b1b7 507:0c939c159af4
1 # redMine - project management software 1 # Redmine - project management software
2 # Copyright (C) 2006-2007 Jean-Philippe Lang 2 # Copyright (C) 2006-2011 Jean-Philippe Lang
3 # 3 #
4 # This program is free software; you can redistribute it and/or 4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License 5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2 6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version. 7 # of the License, or (at your option) any later version.
55 # Sorts types by results count 55 # Sorts types by results count
56 results_by_type.keys.sort {|a, b| results_by_type[b] <=> results_by_type[a]}.each do |t| 56 results_by_type.keys.sort {|a, b| results_by_type[b] <=> results_by_type[a]}.each do |t|
57 c = results_by_type[t] 57 c = results_by_type[t]
58 next if c == 0 58 next if c == 0
59 text = "#{type_label(t)} (#{c})" 59 text = "#{type_label(t)} (#{c})"
60 links << link_to(text, :q => params[:q], :titles_only => params[:title_only], :all_words => params[:all_words], :scope => params[:scope], t => 1) 60 links << link_to(text, :q => params[:q], :titles_only => params[:titles_only], :all_words => params[:all_words], :scope => params[:scope], t => 1)
61 end 61 end
62 ('<ul>' + links.map {|link| content_tag('li', link)}.join(' ') + '</ul>') unless links.empty? 62 ('<ul>' + links.map {|link| content_tag('li', link)}.join(' ') + '</ul>') unless links.empty?
63 end 63 end
64 end 64 end