]> git.openstreetmap.org Git - rails.git/blob - app/views/notes/_note.json.jsonify
c702d9254b49aa886426887da8faf84fcf5b4b94
[rails.git] / app / views / notes / _note.json.jsonify
1 json.type "Feature"
2
3 json.geometry do
4   json.type "Point"
5   json.coordinates [ note.lon, note.lat ]
6 end
7
8 json.properties do
9   json.id note.id
10   json.url note_url(note, :format => params[:format])
11   json.comment_url comment_note_url(note, :format => params[:format])
12   json.close_url close_note_url(note, :format => params[:format])
13   json.date_created note.created_at
14   json.status note.status
15   json.closed_at note.closed_at if note.status == "closed"
16
17   json.comments(note.comments) do |comment|
18     json.date comment.created_at
19
20     if comment.author
21       json.uid comment.author.id
22       json.user comment.author.display_name
23       json.user_url user_url(:display_name => comment.author.display_name)
24     end
25
26     json.action comment.event
27
28     if comment.body
29       json.text comment.body.to_text
30       json.html comment.body.to_html
31     end
32   end
33 end