diff options
| author | hukl <contact@smyck.org> | 2009-09-10 16:20:41 +0200 |
|---|---|---|
| committer | hukl <contact@smyck.org> | 2009-09-10 16:20:41 +0200 |
| commit | 6e41f3d6ae2cda88e5316cec747b6ec79e4c0cd0 (patch) | |
| tree | cb3ae861d6f3821b443675efba7d288312c5baf7 | |
| parent | d7ec763c7ce069824aad24a6bd0d845ee74ed10d (diff) | |
modifications for a valid atom feed
| -rw-r--r-- | app/views/rss/updates.xml.builder | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/app/views/rss/updates.xml.builder b/app/views/rss/updates.xml.builder index 541ad4e..8d873c0 100644 --- a/app/views/rss/updates.xml.builder +++ b/app/views/rss/updates.xml.builder | |||
| @@ -2,17 +2,24 @@ xml.instruct! | |||
| 2 | xml.feed(:xmlns => "http://www.w3.org/2005/Atom") do | 2 | xml.feed(:xmlns => "http://www.w3.org/2005/Atom") do |
| 3 | xml.title("Chaos Computer Club Updates") | 3 | xml.title("Chaos Computer Club Updates") |
| 4 | xml.link(:href => "http://www.ccc.de/") | 4 | xml.link(:href => "http://www.ccc.de/") |
| 5 | xml.updated(@items.first.published_at) | 5 | xml.link(:rel => "self", :href => "/updates.xml") |
| 6 | xml.author("Chaos Computer Club e.V.") | 6 | xml.updated(@items.first.published_at.xmlschema) |
| 7 | xml.author do | ||
| 8 | xml.name("Chaos Computer Club e.V.") | ||
| 9 | end | ||
| 7 | xml.id("http://www.ccc.de/") | 10 | xml.id("http://www.ccc.de/") |
| 8 | 11 | ||
| 9 | @items.each do |item| | 12 | @items.each do |item| |
| 10 | xml.entry do | 13 | xml.entry do |
| 11 | xml.title(item.title) | 14 | xml.title(item.title) |
| 12 | port = (request.port != 80) ? port = ":#{request.port}" : "" | 15 | port = (request.port != 80) ? port = ":#{request.port}" : "" |
| 13 | xml.link(request.protocol + request.host + port + item.public_link) | 16 | xml.link( |
| 17 | :href => "#{request.protocol}#{request.host}#{port}/#{I18n.locale.to_s}" \ | ||
| 18 | "#{item.public_link}", | ||
| 19 | :rel => "alternate" | ||
| 20 | ) | ||
| 14 | xml.id(request.protocol + request.host + port + item.public_link) | 21 | xml.id(request.protocol + request.host + port + item.public_link) |
| 15 | xml.updated(item.updated_at) | 22 | xml.updated(item.updated_at.xmlschema) |
| 16 | xml.content(:type => "xhtml") do | 23 | xml.content(:type => "xhtml") do |
| 17 | xml.div(item.body, :xmlns => "http://www.w3.org/1999/xhtml") | 24 | xml.div(item.body, :xmlns => "http://www.w3.org/1999/xhtml") |
| 18 | end | 25 | end |
