summaryrefslogtreecommitdiffstats
path: root/app/helpers/projects_helper.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-04-30 08:52:39 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-04-30 08:52:39 +0000
commitebe10fa6452de7ea6c5759bfd9c7b439091b54cd (patch)
tree30eb8f2f6fb758c41530597814c2e9d048fc75c8 /app/helpers/projects_helper.rb
parent833c5035a697858cfc390b08e5db204ba30831d9 (diff)
downloadredmine-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/helpers/projects_helper.rb')
-rw-r--r--app/helpers/projects_helper.rb10
1 files changed, 0 insertions, 10 deletions
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb
index 43febd413..c7e80b0a0 100644
--- a/app/helpers/projects_helper.rb
+++ b/app/helpers/projects_helper.rb
@@ -16,14 +16,4 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
module ProjectsHelper
-
- def highlight_tokens(text, tokens)
- return text unless tokens && !tokens.empty?
- regexp = Regexp.new "(#{tokens.join('|')})", Regexp::IGNORECASE
- result = ''
- text.split(regexp).each_with_index do |words, i|
- result << (i.even? ? (words.length > 100 ? "#{words[0..44]} ... #{words[-45..-1]}" : words) : content_tag('span', words, :class => 'highlight'))
- end
- result
- end
end