Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 189
- Log:
Standardised titles for RSS feeds across all applications. Including
previously omitted frozen Rails version - this is required for the
current release of the application to function, so it ought to be in
the repository.
- Author:
- rool
- Date:
- Wed Apr 04 18:26:58 +0100 2007
- Size:
- 4407 Bytes
1 | class RssController < ApplicationController |
2 | before_filter :set_xml_header, :except => [ :index ] |
3 | |
4 | def index |
5 | render :layout => 'application' |
6 | end |
7 | |
8 | def all |
9 | @rss_title = 'ROOL Tracker' |
10 | @items = [] |
11 | |
12 | Ticket.find_all(nil, 'created_at DESC', 5).each do |ticket| |
13 | @items << {:title => "Ticket ##{ticket.id} created: " + ticket.summary, |
14 | :content => ticket.content, |
15 | :author => ticket.author, |
16 | :date => ticket.created_at, |
17 | :link => "tickets/show/#{ticket.id}"} |
18 | end |
19 | |
20 | TicketChange.find_all(nil, 'created_at DESC', 5).each do |change| |
21 | content = '' |
22 | unless change.comment.empty? |
23 | content << "<p>#{change.comment}</p>\n" |
24 | end |
25 | change.each_log {|logitem| content << '<ul>' + format_changes(logitem) + '</ul' } |
26 | |
27 | @items << {:title => "Ticket ##{change.ticket_id} modified by #{change.author}", |
28 | :content => content, |
29 | :author => change.author, |
30 | :date => change.created_at, |
31 | :link => "tickets/show/#{change.ticket_id}"} |
32 | end |
33 | |
34 | Changeset.find_all(nil, 'created_at DESC', 5).each do |changeset| |
35 | @items << {:title => "Changeset #{changeset.revision} by #{changeset.author}", |
36 | :content => changeset.log, |
37 | :author => changeset.author, |
38 | :date => changeset.revised_at, |
39 | :link => "repository/changesets/#{changeset.revision}"} |
40 | end |
41 | render :action => 'rss' |
42 | end |
43 | |
44 | def tickets |
45 | @rss_title = 'ROOL Tracker: All tickets' |
46 | @items = [] |
47 | |
48 | Ticket.find_all(nil, 'created_at DESC', 5).each do |ticket| |
49 | @items << {:title => "Ticket ##{ticket.id} created: " + ticket.summary, |
50 | :content => ticket.content, |
51 | :author => ticket.author, |
52 | :date => ticket.created_at, |
53 | :link => "tickets/show/#{ticket.id}"} |
54 | end |
55 | |
56 | TicketChange.find_all(nil, 'created_at DESC', 5).each do |change| |
57 | content = '' |
58 | unless change.comment.empty? |
59 | content << "<p>#{change.comment}</p>\n" |
60 | end |
61 | change.each_log {|logitem| content << '<ul>' + format_changes(logitem) + '</ul>' } |
62 | |
63 | @items << {:title => "Ticket ##{change.ticket_id} modified by #{change.author}", |
64 | :content => content, |
65 | :author => change.author, |
66 | :date => change.created_at, |
67 | :link => "tickets/show/#{change.ticket_id}"} |
68 | end |
69 | render :action => 'rss' |
70 | end |
71 | |
72 | def ticket_creation |
73 | @rss_title = 'ROOL Tracker: Ticket creation' |
74 | @items = [] |
75 | |
76 | Ticket.find_all(nil, 'created_at DESC', 5).each do |ticket| |
77 | @items << {:title => "Ticket ##{ticket.id} created: " + ticket.summary, |
78 | :content => ticket.content, |
79 | :author => ticket.author, |
80 | :date => ticket.created_at, |
81 | :link => "tickets/show/#{ticket.id}"} |
82 | end |
83 | render :action => 'rss' |
84 | end |
85 | |
86 | def ticket_changes |
87 | @rss_title = 'ROOL Tracker: Ticket changes' |
88 | @items = [] |
89 | |
90 | TicketChange.find_all(nil, 'created_at DESC', 5).each do |change| |
91 | content = '' |
92 | unless change.comment.empty? |
93 | content << "<p>#{change.comment}</p>\n" |
94 | end |
95 | change.each_log {|logitem| content << '<ul>' + format_changes(logitem) + '</ul>' } |
96 | |
97 | @items << {:title => "Ticket ##{change.ticket_id} modified by #{change.author}", |
98 | :content => content, |
99 | :author => change.author, |
100 | :date => change.created_at, |
101 | :link => "tickets/show/#{change.ticket_id}"} |
102 | end |
103 | render :action => 'rss' |
104 | end |
105 | |
106 | def changesets |
107 | @rss_title = 'ROOL Tracker: Changesets' |
108 | @items = [] |
109 | Changeset.find_all(nil, 'created_at DESC', 15).each do |changeset| |
110 | @items << {:title => "Changeset #{changeset.revision} by #{changeset.author}", |
111 | :content => changeset.log, |
112 | :author => changeset.author, |
113 | :date => changeset.revised_at, |
114 | :link => "repository/changesets/#{changeset.revision}"} |
115 | end |
116 | render :action => 'rss' |
117 | end |
118 | |
119 | private |
120 | def format_changes(change_arr) |
121 | "<li><strong>#{change_arr[0]}</strong> changed from <em>#{change_arr[1]}</em> to <em>#{change_arr[2]}</em></li>" |
122 | end |
123 | |
124 | def set_xml_header |
125 | headers["Content-Type"] = "text/xml; charset=utf-8" |
126 | end |
127 | |
128 | end |