Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 24
- Log:
Initial import of Collaboa 0.5.6 from downloaded Tarball. Collaboa is
a Ruby On Rails based bug tracker and SVN repository browsing tool.
- Author:
- adh
- Date:
- Mon Jul 24 21:54:39 +0100 2006
- Size:
- 3270 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 = 'Collaboa' |
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 = 'Collaboa - 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 changesets |
73 | @rss_title = 'Collaboa - Changesets' |
74 | @items = [] |
75 | Changeset.find_all(nil, 'created_at DESC', 15).each do |changeset| |
76 | @items << {:title => "Changeset #{changeset.revision} by #{changeset.author}", |
77 | :content => changeset.log, |
78 | :author => changeset.author, |
79 | :date => changeset.revised_at, |
80 | :link => "repository/changesets/#{changeset.revision}"} |
81 | end |
82 | render :action => 'rss' |
83 | end |
84 | |
85 | private |
86 | def format_changes(change_arr) |
87 | "<li><strong>#{change_arr[0]}</strong> changed from <em>#{change_arr[1]}</em> to <em>#{change_arr[2]}</em></li>" |
88 | end |
89 | |
90 | def set_xml_header |
91 | headers["Content-Type"] = "text/xml; charset=utf-8" |
92 | end |
93 | |
94 | end |