mirror of
https://github.com/meineerde/redmine.git
synced 2025-12-23 00:41:14 +00:00
add empty line after guard clause to SearchHelper
git-svn-id: http://svn.redmine.org/redmine/trunk@20234 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
5f8d73108e
commit
8de9cd47e4
@ -20,6 +20,7 @@
|
|||||||
module SearchHelper
|
module SearchHelper
|
||||||
def highlight_tokens(text, tokens)
|
def highlight_tokens(text, tokens)
|
||||||
return text unless text && tokens && !tokens.empty?
|
return text unless text && tokens && !tokens.empty?
|
||||||
|
|
||||||
re_tokens = tokens.collect {|t| Regexp.escape(t)}
|
re_tokens = tokens.collect {|t| Regexp.escape(t)}
|
||||||
regexp = Regexp.new "(#{re_tokens.join('|')})", Regexp::IGNORECASE
|
regexp = Regexp.new "(#{re_tokens.join('|')})", Regexp::IGNORECASE
|
||||||
result = +''
|
result = +''
|
||||||
@ -58,6 +59,7 @@ module SearchHelper
|
|||||||
results_by_type.keys.sort_by {|k| results_by_type[k]}.reverse_each do |t|
|
results_by_type.keys.sort_by {|k| results_by_type[k]}.reverse_each do |t|
|
||||||
c = results_by_type[t]
|
c = results_by_type[t]
|
||||||
next if c == 0
|
next if c == 0
|
||||||
|
|
||||||
text = "#{type_label(t)} (#{c})"
|
text = "#{type_label(t)} (#{c})"
|
||||||
links << link_to(h(text), :q => params[:q], :titles_only => params[:titles_only],
|
links << link_to(h(text), :q => params[:q], :titles_only => params[:titles_only],
|
||||||
:all_words => params[:all_words], :scope => params[:scope], t => 1)
|
:all_words => params[:all_words], :scope => params[:scope], t => 1)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user