]> git.openstreetmap.org Git - rails.git/blob - app/views/api/notes/_note.xml.builder
Add frozen_string_literal comments to ruby files
[rails.git] / app / views / api / notes / _note.xml.builder
1 # frozen_string_literal: true
2
3 xml.note("lon" => note.lon, "lat" => note.lat) do
4   xml.id note.id
5   xml.url api_note_url(note, :format => params[:format])
6
7   if note.closed?
8     xml.reopen_url reopen_api_note_url(note, :format => params[:format])
9   else
10     xml.comment_url comment_api_note_url(note, :format => params[:format])
11     xml.close_url close_api_note_url(note, :format => params[:format])
12   end
13
14   xml.date_created note.created_at
15   xml.status note.status
16
17   xml.date_closed note.closed_at if note.closed?
18
19   xml.comments do
20     note.comments.each do |comment|
21       xml.comment do
22         xml.date comment.created_at
23
24         if comment.author
25           xml.uid comment.author.id
26           xml.user comment.author.display_name
27           xml.user_url user_url(:display_name => comment.author.display_name, :only_path => false)
28         end
29
30         xml.action comment.event
31
32         if comment.body
33           xml.text comment.body.to_text
34           xml.html comment.body.to_html
35         end
36       end
37     end
38   end
39 end