]> git.openstreetmap.org Git - rails.git/blob - app/views/map_bugs/rss.rss.builder
Merge branch 'master' into openstreetbugs
[rails.git] / app / views / map_bugs / rss.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 "OpenStreetBugs"
8     xml.description t('bugs.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         for comment in @comments
12       xml.item do
13                 if comment.event == "closed"
14                         xml.title t('bugs.rss.closed', :place => comment.map_bug.nearby_place)  
15                 else if comment.event == "commented"
16                         xml.title t('bugs.rss.comment', :place => comment.map_bug.nearby_place)
17                 else if comment.event == "opened"
18                         xml.title t('bugs.rss.new', :place => comment.map_bug.nearby_place)
19                 else
20                         xml.title "unknown event"
21                 end     end end
22         
23         xml.link url_for(:controller => "browse", :action => "bug", :id => comment.map_bug.id, :only_path => false)
24                 xml.guid url_for(:controller => "browse", :action => "bug", :id => comment.map_bug.id, :only_path => false)
25
26                 description_text = ""
27         if (comment.event == "commented") and (not comment.nil?)
28                         description_text += "<B> Comment: </B><br>"
29                         description_text += htmlize(comment.comment)
30                         description_text += "<br>"
31                 end
32                 description_text += "<B> Full bug report: </B><br>"
33                 description_text += comment.map_bug.flatten_comment("<br>", comment.date_created)
34                 xml.description description_text 
35
36                 if (comment.user.nil?)
37                         xml.author comment.commenter_name
38                 else
39                         xml.author comment.user.display_name
40                 end
41                 
42         xml.pubDate comment.date_created.to_s(:rfc822)
43           xml.geo :lat, comment.map_bug.lat
44           xml.geo :long, comment.map_bug.lon
45           xml.georss :point, "#{comment.map_bug.lat} #{comment.map_bug.lon}"
46       end
47         end
48   end
49 end