]> git.openstreetmap.org Git - rails.git/blob - app/views/notes/feed.rss.builder
Cast the locale to a string
[rails.git] / app / views / notes / feed.rss.builder
1 xml.instruct!
2
3 xml.rss("version" => "2.0", 
4         "xmlns:geo" => "http://www.w3.org/2003/01/geo/wgs84_pos#",
5         "xmlns:georss" => "http://www.georss.org/georss") do
6   xml.channel do
7     xml.title t('note.rss.title')
8     xml.description t('note.rss.description_area', :min_lat => @min_lat, :min_lon => @min_lon, :max_lat => @max_lat, :max_lon => @max_lon )
9     xml.link url_for(:controller => "site", :action => "index", :only_path => false)
10
11     @comments.each do |comment|
12       location = describe_location(comment.note.lat, comment.note.lon, 14, locale)
13
14       xml.item do
15         if comment.event == "closed"
16           xml.title t('note.rss.closed', :place => location)
17         elsif comment.event == "commented"
18           xml.title t('note.rss.comment', :place => location)
19         elsif comment.event == "opened"
20           xml.title t('note.rss.new', :place => location)
21         else
22           xml.title "unknown event"
23         end
24         
25         xml.link url_for(:controller => "browse", :action => "note", :id => comment.note.id, :only_path => false)
26         xml.guid url_for(:controller => "browse", :action => "note", :id => comment.note.id, :only_path => false)
27
28         xml.description do
29           xml.cdata! render(:partial => "entry", :object => comment, :formats => [ :html ])
30         end
31
32         if comment.author
33           xml.author comment.author.display_name
34         end
35
36         xml.pubDate comment.created_at.to_s(:rfc822)
37         xml.geo :lat, comment.note.lat
38         xml.geo :long, comment.note.lon
39         xml.georss :point, "#{comment.note.lat} #{comment.note.lon}"
40       end
41     end
42   end
43 end