]> git.openstreetmap.org Git - rails.git/blob - app/views/map_bugs/_bug.xml.builder
Factor out common code into partials
[rails.git] / app / views / map_bugs / _bug.xml.builder
1 xml.bug("lon" => bug.lon, "lat" => bug.lat) do
2   xml.id bug.id
3   xml.date_created bug.date_created
4   xml.nearby bug.nearby_place
5   xml.status bug.status
6
7   if bug.status == "closed"
8     xml.date_closed bug.date_closed
9   end
10
11   xml.comments do
12     bug.map_bug_comment.each do |comment|
13       xml.comment do
14         xml.date comment.date_created
15
16         unless comment.commenter_id.nil?
17           xml.uid comment.commenter_id
18           xml.user comment.user.display_name    
19         else
20           xml.user comment.commenter_name
21         end
22
23         xml.text comment.comment
24       end       
25     end
26   end
27 end