Remove nearby_place from the note model
[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_string = Rails.cache.fetch("location_description_#{comment.note.lat}_#{comment.note.lon}_#{locale}") do
13         describe_location comment.note.lat, comment.note.lon, 14, locale
14       end
15       xml.item do
16         if comment.event == "closed"
17           xml.title t('note.rss.closed', :place => location_string)     
18         elsif comment.event == "commented"
19           xml.title t('note.rss.comment', :place => location_string)
20         elsif comment.event == "opened"
21           xml.title t('note.rss.new', :place => location_string)
22         else
23           xml.title "unknown event"
24         end
25         
26         xml.link url_for(:controller => "browse", :action => "note", :id => comment.note.id, :only_path => false)
27         xml.guid url_for(:controller => "browse", :action => "note", :id => comment.note.id, :only_path => false)
28
29         description_text = ""
30
31         if comment.event == "commented" and not comment.nil?
32           description_text += "<b>Comment:</b><br>"
33           description_text += comment.body.to_html
34           description_text += "<br>"
35         end
36
37         description_text += "<b>Full note:</b><br>"
38         description_text += comment.note.flatten_comment("<br>", comment.created_at)
39
40         xml.description description_text 
41         xml.author comment.author_name
42         xml.pubDate comment.created_at.to_s(:rfc822)
43         xml.geo :lat, comment.note.lat
44         xml.geo :long, comment.note.lon
45         xml.georss :point, "#{comment.note.lat} #{comment.note.lon}"
46       end
47     end
48   end
49 end