summaryrefslogtreecommitdiffstats
path: root/app/views/journals/index.builder
blob: a7ddd71c43047076615e506e967fa62843132014 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# frozen_string_literal: true

xml.instruct!
xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do
  xml.title   @title
  xml.link    "rel" => "self", "href" => url_for(:format => 'atom', :key => User.current.atom_key, :only_path => false)
  xml.link    "rel" => "alternate", "href" => home_url
  xml.id      home_url
  xml.sprite_icon favicon_url
  xml.updated((@journals.first ? @journals.first.event_datetime : Time.now).xmlschema)
  xml.author  {xml.name "#{Setting.app_title}"}
  @journals.each do |change|
    issue = change.issue
    xml.entry do
      xml.title   "#{issue.project.name} - #{issue.tracker.name} ##{issue.id}: #{issue.subject}"
      xml.link    "rel" => "alternate", "href" => issue_url(issue)
      xml.id      issue_url(issue, :journal_id => change)
      xml.updated change.created_on.xmlschema
      xml.author do
        xml.name change.user.name
        xml.email(change.user.mail) if change.user.is_a?(User) && change.user.mail.present? && !change.user.pref.hide_mail
      end
      xml.content "type" => "html" do
        xml.text! '<ul>'
        details_to_strings(change.visible_details, false).each do |string|
          xml.text! '<li>' + string + '</li>'
        end
        xml.text! '</ul>'
        xml.text! textilizable(change, :notes, :only_path => false) unless change.notes.blank?
      end
    end
  end
end