summaryrefslogtreecommitdiff
path: root/app/views/rss/updates.xml.builder
blob: f5cad621d0a3e2e566f76db909c7b0d4a0d91ab9 (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
xml.instruct!

xml.feed(:xmlns => "http://www.w3.org/2005/Atom", "xml:base" => @host) do
  xml.title("Chaos Computer Club Updates")
  xml.link(:href => "#{@host}")
  xml.link(:rel => "self", :href => "#{@host}/rss/updates.xml")
  xml.updated((@items.map(&:updated_at).compact.max || Time.now).xmlschema)
  xml.author do
    xml.name("Chaos Computer Club e.V.")
  end
  xml.id("#{@host}/rss/updates")
  
  @items.each do |item|
    xml.entry do
      xml.title(item.title.to_s)
      xml.link(
        :href => content_url(:page_path => item.node.unique_path),
        :rel  => "alternate",
        :type => "text/html"
      )
      xml.id(content_url(:page_path => item.node.feed_id))
      xml.updated(item.updated_at.xmlschema)
      xml.published(item.published_at.xmlschema)
      xml.summary(item.abstract.to_s)
      xml.content(item.body.to_s, :type => "html")
    end
    
  end
  
end