]> git.openstreetmap.org Git - rails.git/blob - app/views/api/changesets/_changeset.json.jbuilder
Change diary comments pagination to before/after id
[rails.git] / app / views / api / changesets / _changeset.json.jbuilder
1 # basic attributes
2 json.id changeset.id
3 json.created_at changeset.created_at.xmlschema
4 json.open changeset.open?
5 json.comments_count changeset.comments.length
6 json.changes_count changeset.num_changes
7
8 json.closed_at changeset.closed_at.xmlschema unless changeset.open?
9 if changeset.bbox.complete?
10   json.min_lat GeoRecord::Coord.new(changeset.bbox.to_unscaled.min_lat)
11   json.min_lon GeoRecord::Coord.new(changeset.bbox.to_unscaled.min_lon)
12   json.max_lat GeoRecord::Coord.new(changeset.bbox.to_unscaled.max_lat)
13   json.max_lon GeoRecord::Coord.new(changeset.bbox.to_unscaled.max_lon)
14 end
15
16 # user attributes
17 if changeset.user.data_public?
18   json.uid changeset.user_id
19   json.user changeset.user.display_name
20 end
21
22 json.tags changeset.tags unless changeset.tags.empty?
23
24 if @include_discussion
25   json.comments(changeset.comments) do |comment|
26     json.date comment.created_at.xmlschema
27     if comment.author.data_public?
28       json.uid comment.author.id
29       json.user comment.author.display_name
30     end
31     json.text comment.body
32   end
33 end