comparison app/helpers/.svn/text-base/search_helper.rb.svn-base @ 523:0b6c82dead28 luisf

Merge from branch "cannam"
author luisf <luis.figueira@eecs.qmul.ac.uk>
date Mon, 25 Jul 2011 14:23:37 +0100
parents 0c939c159af4
children
comparison
equal deleted inserted replaced
318:f7c525dc7585 523:0b6c82dead28
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