From: mmd-osm Date: Wed, 26 Jun 2019 20:29:18 +0000 (+0200) Subject: Simplify partial rendering X-Git-Tag: live~3103^2~7 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/d0de9967b9bd21c8e7c03e060626c4486b149fb2 Simplify partial rendering --- diff --git a/app/views/api/map/index.xml.builder b/app/views/api/map/index.xml.builder index 841ea8384..d7fb7e7fc 100644 --- a/app/views/api/map/index.xml.builder +++ b/app/views/api/map/index.xml.builder @@ -2,7 +2,7 @@ xml.instruct! xml.osm(OSM::API.new.xml_root_attributes) do |osm| osm << (render(:partial => "bounds", :object => @bounds) || "") - osm << (render(:partial => "node", :collection => @nodes) || "") - osm << (render(:partial => "way", :collection => @ways) || "") - osm << (render(:partial => "relation", :collection => @relations) || "") + osm << (render(@nodes) || "") + osm << (render(@ways) || "") + osm << (render(@relations) || "") end diff --git a/app/views/api/map/_node.xml.builder b/app/views/api/nodes/_node.xml.builder similarity index 100% rename from app/views/api/map/_node.xml.builder rename to app/views/api/nodes/_node.xml.builder diff --git a/app/views/api/nodes/index.xml.builder b/app/views/api/nodes/index.xml.builder index 5c73c2193..1968de97a 100644 --- a/app/views/api/nodes/index.xml.builder +++ b/app/views/api/nodes/index.xml.builder @@ -1,5 +1,5 @@ xml.instruct! xml.osm(OSM::API.new.xml_root_attributes) do |osm| - osm << (render(:partial => "api/map/node", :collection => @nodes) || "") + osm << (render(@nodes) || "") end diff --git a/app/views/api/nodes/show.xml.builder b/app/views/api/nodes/show.xml.builder index 5c73c2193..1968de97a 100644 --- a/app/views/api/nodes/show.xml.builder +++ b/app/views/api/nodes/show.xml.builder @@ -1,5 +1,5 @@ xml.instruct! xml.osm(OSM::API.new.xml_root_attributes) do |osm| - osm << (render(:partial => "api/map/node", :collection => @nodes) || "") + osm << (render(@nodes) || "") end diff --git a/app/views/api/old_nodes/history.xml.builder b/app/views/api/old_nodes/history.xml.builder index fd07025df..905381ce9 100644 --- a/app/views/api/old_nodes/history.xml.builder +++ b/app/views/api/old_nodes/history.xml.builder @@ -1,5 +1,5 @@ xml.instruct! xml.osm(OSM::API.new.xml_root_attributes) do |osm| - osm << (render(:partial => "old_node", :collection => @elems) || "") + osm << (render(@elems) || "") end diff --git a/app/views/api/old_nodes/version.xml.builder b/app/views/api/old_nodes/version.xml.builder index fd07025df..905381ce9 100644 --- a/app/views/api/old_nodes/version.xml.builder +++ b/app/views/api/old_nodes/version.xml.builder @@ -1,5 +1,5 @@ xml.instruct! xml.osm(OSM::API.new.xml_root_attributes) do |osm| - osm << (render(:partial => "old_node", :collection => @elems) || "") + osm << (render(@elems) || "") end diff --git a/app/views/api/old_relations/history.xml.builder b/app/views/api/old_relations/history.xml.builder index 7e01b2490..905381ce9 100644 --- a/app/views/api/old_relations/history.xml.builder +++ b/app/views/api/old_relations/history.xml.builder @@ -1,5 +1,5 @@ xml.instruct! xml.osm(OSM::API.new.xml_root_attributes) do |osm| - osm << (render(:partial => "old_relation", :collection => @elems) || "") + osm << (render(@elems) || "") end diff --git a/app/views/api/old_relations/version.xml.builder b/app/views/api/old_relations/version.xml.builder index 7e01b2490..905381ce9 100644 --- a/app/views/api/old_relations/version.xml.builder +++ b/app/views/api/old_relations/version.xml.builder @@ -1,5 +1,5 @@ xml.instruct! xml.osm(OSM::API.new.xml_root_attributes) do |osm| - osm << (render(:partial => "old_relation", :collection => @elems) || "") + osm << (render(@elems) || "") end diff --git a/app/views/api/old_ways/history.xml.builder b/app/views/api/old_ways/history.xml.builder index c04d74577..905381ce9 100644 --- a/app/views/api/old_ways/history.xml.builder +++ b/app/views/api/old_ways/history.xml.builder @@ -1,5 +1,5 @@ xml.instruct! xml.osm(OSM::API.new.xml_root_attributes) do |osm| - osm << (render(:partial => "old_way", :collection => @elems) || "") + osm << (render(@elems) || "") end diff --git a/app/views/api/old_ways/version.xml.builder b/app/views/api/old_ways/version.xml.builder index c04d74577..905381ce9 100644 --- a/app/views/api/old_ways/version.xml.builder +++ b/app/views/api/old_ways/version.xml.builder @@ -1,5 +1,5 @@ xml.instruct! xml.osm(OSM::API.new.xml_root_attributes) do |osm| - osm << (render(:partial => "old_way", :collection => @elems) || "") + osm << (render(@elems) || "") end diff --git a/app/views/api/map/_relation.xml.builder b/app/views/api/relations/_relation.xml.builder similarity index 100% rename from app/views/api/map/_relation.xml.builder rename to app/views/api/relations/_relation.xml.builder diff --git a/app/views/api/relations/full.xml.builder b/app/views/api/relations/full.xml.builder index e7e6c92bc..e23061727 100644 --- a/app/views/api/relations/full.xml.builder +++ b/app/views/api/relations/full.xml.builder @@ -1,7 +1,7 @@ xml.instruct! xml.osm(OSM::API.new.xml_root_attributes) do |osm| - osm << (render(:partial => "api/map/node", :collection => @nodes) || "") - osm << (render(:partial => "api/map/way", :collection => @ways) || "") - osm << (render(:partial => "api/map/relation", :collection => @relations) || "") + osm << (render(@nodes) || "") + osm << (render(@ways) || "") + osm << (render(@relations) || "") end diff --git a/app/views/api/relations/index.xml.builder b/app/views/api/relations/index.xml.builder index a753e8ea8..f39a20bb9 100644 --- a/app/views/api/relations/index.xml.builder +++ b/app/views/api/relations/index.xml.builder @@ -1,5 +1,5 @@ xml.instruct! xml.osm(OSM::API.new.xml_root_attributes) do |osm| - osm << (render(:partial => "api/map/relation", :collection => @relations) || "") + osm << (render(@relations) || "") end diff --git a/app/views/api/relations/relations_for_node.xml.builder b/app/views/api/relations/relations_for_node.xml.builder index a753e8ea8..f39a20bb9 100644 --- a/app/views/api/relations/relations_for_node.xml.builder +++ b/app/views/api/relations/relations_for_node.xml.builder @@ -1,5 +1,5 @@ xml.instruct! xml.osm(OSM::API.new.xml_root_attributes) do |osm| - osm << (render(:partial => "api/map/relation", :collection => @relations) || "") + osm << (render(@relations) || "") end diff --git a/app/views/api/relations/relations_for_relation.xml.builder b/app/views/api/relations/relations_for_relation.xml.builder index a753e8ea8..f39a20bb9 100644 --- a/app/views/api/relations/relations_for_relation.xml.builder +++ b/app/views/api/relations/relations_for_relation.xml.builder @@ -1,5 +1,5 @@ xml.instruct! xml.osm(OSM::API.new.xml_root_attributes) do |osm| - osm << (render(:partial => "api/map/relation", :collection => @relations) || "") + osm << (render(@relations) || "") end diff --git a/app/views/api/relations/relations_for_way.xml.builder b/app/views/api/relations/relations_for_way.xml.builder index a753e8ea8..f39a20bb9 100644 --- a/app/views/api/relations/relations_for_way.xml.builder +++ b/app/views/api/relations/relations_for_way.xml.builder @@ -1,5 +1,5 @@ xml.instruct! xml.osm(OSM::API.new.xml_root_attributes) do |osm| - osm << (render(:partial => "api/map/relation", :collection => @relations) || "") + osm << (render(@relations) || "") end diff --git a/app/views/api/relations/show.xml.builder b/app/views/api/relations/show.xml.builder index a753e8ea8..f39a20bb9 100644 --- a/app/views/api/relations/show.xml.builder +++ b/app/views/api/relations/show.xml.builder @@ -1,5 +1,5 @@ xml.instruct! xml.osm(OSM::API.new.xml_root_attributes) do |osm| - osm << (render(:partial => "api/map/relation", :collection => @relations) || "") + osm << (render(@relations) || "") end diff --git a/app/views/api/map/_way.xml.builder b/app/views/api/ways/_way.xml.builder similarity index 100% rename from app/views/api/map/_way.xml.builder rename to app/views/api/ways/_way.xml.builder diff --git a/app/views/api/ways/full.xml.builder b/app/views/api/ways/full.xml.builder index 93ca2c087..d8b3aea80 100644 --- a/app/views/api/ways/full.xml.builder +++ b/app/views/api/ways/full.xml.builder @@ -1,6 +1,6 @@ xml.instruct! xml.osm(OSM::API.new.xml_root_attributes) do |osm| - osm << (render(:partial => "api/map/node", :collection => @nodes) || "") - osm << (render(:partial => "api/map/way", :collection => @ways) || "") + osm << (render(@nodes) || "") + osm << (render(@ways) || "") end diff --git a/app/views/api/ways/index.xml.builder b/app/views/api/ways/index.xml.builder index 33818c68f..bcb89cdc6 100644 --- a/app/views/api/ways/index.xml.builder +++ b/app/views/api/ways/index.xml.builder @@ -1,5 +1,5 @@ xml.instruct! xml.osm(OSM::API.new.xml_root_attributes) do |osm| - osm << (render(:partial => "api/map/way", :collection => @ways) || "") + osm << (render(@ways) || "") end diff --git a/app/views/api/ways/show.xml.builder b/app/views/api/ways/show.xml.builder index 33818c68f..bcb89cdc6 100644 --- a/app/views/api/ways/show.xml.builder +++ b/app/views/api/ways/show.xml.builder @@ -1,5 +1,5 @@ xml.instruct! xml.osm(OSM::API.new.xml_root_attributes) do |osm| - osm << (render(:partial => "api/map/way", :collection => @ways) || "") + osm << (render(@ways) || "") end diff --git a/app/views/api/ways/ways_for_node.xml.builder b/app/views/api/ways/ways_for_node.xml.builder index 33818c68f..bcb89cdc6 100644 --- a/app/views/api/ways/ways_for_node.xml.builder +++ b/app/views/api/ways/ways_for_node.xml.builder @@ -1,5 +1,5 @@ xml.instruct! xml.osm(OSM::API.new.xml_root_attributes) do |osm| - osm << (render(:partial => "api/map/way", :collection => @ways) || "") + osm << (render(@ways) || "") end