try and make the OpenStreetBugs API a bit more consistent with the rest of the API
[rails.git] / app / views / map_bugs / get_bugs.xml.builder
1 xml.instruct!
2
3 xml.bugs do
4         for bug in @bugs
5                 xml.bug("lon" => bug.lon, "lat" => bug.lat) do
6                         xml.id bug.id
7                         xml.date_created bug.date_created
8                         xml.nearby bug.nearby_place
9                         xml.status bug.status
10                         if bug.status == "closed"
11                                 xml.date_closed bug.date_closed
12                         end
13                         xml.comments do
14                                 for comment in bug.map_bug_comment
15                                         xml.comment do
16                                                 xml.date comment.date_created
17                                                 if !comment.commenter_id.nil?
18                                                         xml.uid comment.commenter_id
19                                                         xml.user comment.user.display_name      
20                                                 else
21                                                         xml.user comment.commenter_name
22                                                 end
23                                                 xml.text comment.comment
24                                         end     
25                                 end
26                         end
27                 end
28         end
29 end