Atom feeds for events
[gitorious:yousource.git] / app / views / repositories / show.atom.builder
1 atom_feed do |feed|
2   feed.title("Gitorious: #{@project.slug}/#{@repository.name} activity")
3   feed.updated((@events.blank? ? Time.now : @events.first.created_at))
4
5   @events.each do |event|
6     action, body, category = action_and_body_for_event(event)
7     item_url = "http://#{GitoriousConfig['gitorious_host']}" + project_repository_path(@project, @repository)
8     feed.entry(event, :url => item_url) do |entry|
9       entry.title("#{h(event.user.login)} #{strip_tags(action)}")
10       entry.content(<<-EOS, :type => 'html')
11 <p>#{link_to event.user.login, user_path(event.user)} #{action}</p>
12 <p>#{body}<p>
13 EOS
14       entry.author do |author|
15         author.name(event.user.login)
16       end
17     end
18   end
19 end