Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 454
- Log:
Add auto-linking to bug report and comment parsing.
- Author:
- rool
- Date:
- Fri Sep 06 07:14:17 +0100 2013
- Size:
- 923 Bytes
1 | # The methods added to this helper will be available to all templates in the application. |
2 | |
3 | class Object::Array |
4 | def cycle() |
5 | self.each_with_index {|o, i| yield(o, %w(odd even)[i % 2])} |
6 | end |
7 | end |
8 | |
9 | module ApplicationHelper |
10 | def make_links(text) |
11 | text.gsub!(/changeset\s#?([0-9]+)/i){|s| link_to("Changeset ##{$1}", :controller => 'repository', :action => 'show_changeset', :revision => $1)} |
12 | text.gsub!(/ticket\s#?([0-9]+)/i){|s| link_to("Ticket ##{$1}", :controller => 'tickets', :action => 'show', :id => $1)} |
13 | return text |
14 | end |
15 | |
16 | def format_and_make_links(text) |
17 | text = make_links(text) |
18 | text = simple_format(text) |
19 | return text |
20 | end |
21 | |
22 | def htmlize(text) |
23 | return if text.nil? |
24 | text.gsub!("<", "<") |
25 | text.gsub!(">", ">") |
26 | text = auto_link( text ) { |visible| truncate(visible, 50) } |
27 | text = RedCloth.new(text).to_html |
28 | return text |
29 | end |
30 | |
31 | def request |
32 | @request |
33 | end |
34 | end |