forked from openstreetmap/openstreetmap-website
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Get returning of bugs as GPX files working
- Loading branch information
Showing
5 changed files
with
29 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
xml.wpt("lon" => bug.lon, "lat" => bug.lat) do | ||
xml.desc do | ||
xml.cdata! bug.flatten_comment("<hr />") | ||
end | ||
|
||
xml.extension do | ||
if bug.status = "open" | ||
xml.closed "0" | ||
else | ||
xml.closed "1" | ||
end | ||
|
||
xml.id bug.id | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,7 @@ | ||
xml.instruct! | ||
|
||
|
||
xml.gpx("version" => "1.1", | ||
"xmlns:xsi" => "http://www.w3.org/2001/XMLSchema-instance", | ||
"xsi:schemaLocation" => "http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd") do | ||
|
||
for bug in @bugs | ||
xml.wpt("lon" => bug.lon, "lat" => bug.lat) do | ||
xml.desc do | ||
xml.cdata! bug.flatten_comment("<hr />") | ||
end | ||
xml.extension do | ||
if bug.status = "open" | ||
xml.closed "0" | ||
else | ||
xml.closed "1" | ||
end | ||
xml.id bug.id | ||
end | ||
end | ||
end | ||
"xsi:schemaLocation" => "http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd") do | ||
xml << render(:partial => "bug", :collection => @bugs) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
xml.instruct! | ||
|
||
xml.gpx("version" => "1.1", | ||
"xmlns:xsi" => "http://www.w3.org/2001/XMLSchema-instance", | ||
"xsi:schemaLocation" => "http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd") do | ||
xml << render(:partial => "bug", :object => @bug) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
# Be sure to restart your server when you modify this file. | ||
|
||
# Add new mime types for use in respond_to blocks: | ||
# Mime::Type.register "text/richtext", :rtf | ||
# Mime::Type.register_alias "text/html", :iphone | ||
|
||
Mime::Type.register "application/gpx+xml", :gpx |