]> git.openstreetmap.org Git - rails.git/blob - app/views/api/old_nodes/_old_node.xml.builder
Merge remote-tracking branch 'upstream/pull/2881'
[rails.git] / app / views / api / old_nodes / _old_node.xml.builder
1 attrs = {
2   "id" => old_node.node_id,
3   "visible" => old_node.visible,
4   "version" => old_node.version,
5   "changeset" => old_node.changeset_id,
6   "timestamp" => old_node.timestamp.xmlschema,
7   "user" => old_node.changeset.user.display_name,
8   "uid" => old_node.changeset.user_id
9 }
10
11 if old_node.visible
12   attrs["lat"] = old_node.lat
13   attrs["lon"] = old_node.lon
14 end
15
16 if old_node.tags.empty?
17   xml.node(attrs)
18 else
19   xml.node(attrs) do |nd|
20     old_node.tags.each do |k, v|
21       nd.tag(:k => k, :v => v)
22     end
23   end
24 end