Factor out common code into partials
This commit is contained in:
parent
4b0191befd
commit
560e41ebf9
6 changed files with 54 additions and 93 deletions
27
app/views/map_bugs/_bug.xml.builder
Normal file
27
app/views/map_bugs/_bug.xml.builder
Normal file
|
@ -0,0 +1,27 @@
|
|||
xml.bug("lon" => bug.lon, "lat" => bug.lat) do
|
||||
xml.id bug.id
|
||||
xml.date_created bug.date_created
|
||||
xml.nearby bug.nearby_place
|
||||
xml.status bug.status
|
||||
|
||||
if bug.status == "closed"
|
||||
xml.date_closed bug.date_closed
|
||||
end
|
||||
|
||||
xml.comments do
|
||||
bug.map_bug_comment.each do |comment|
|
||||
xml.comment do
|
||||
xml.date comment.date_created
|
||||
|
||||
unless comment.commenter_id.nil?
|
||||
xml.uid comment.commenter_id
|
||||
xml.user comment.user.display_name
|
||||
else
|
||||
xml.user comment.commenter_name
|
||||
end
|
||||
|
||||
xml.text comment.comment
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue