[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Maposmatic-dev] [PATCH] Adding links from jobs to OpenStreetMap main si
From: |
Pierre Mauduit |
Subject: |
[Maposmatic-dev] [PATCH] Adding links from jobs to OpenStreetMap main site |
Date: |
Wed, 4 Aug 2010 22:03:07 +0200 |
Signed-off-by: Pierre Mauduit <address@hidden>
---
www/maposmatic/templatetags/extratags.py | 1 +
www/templates/maposmatic/job.html | 4 ++++
2 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/www/maposmatic/templatetags/extratags.py
b/www/maposmatic/templatetags/extratags.py
index 0eb02a7..a41ff9f 100644
--- a/www/maposmatic/templatetags/extratags.py
+++ b/www/maposmatic/templatetags/extratags.py
@@ -68,3 +68,4 @@ def feedparsed(value):
register.filter('job_status_to_str', job_status_to_str)
register.filter('job_status_to_icon_name', job_status_to_icon_name)
register.filter('feedparsed', feedparsed)
+register.filter('abs', lambda x: abs(x))
diff --git a/www/templates/maposmatic/job.html
b/www/templates/maposmatic/job.html
index e635cdf..4ff59ea 100644
--- a/www/templates/maposmatic/job.html
+++ b/www/templates/maposmatic/job.html
@@ -78,6 +78,10 @@
{% if not job.output_files.indeces|length %}{% blocktrans %}No index was
generated because no information was available in OpenStreetMap to create one.
Feel free to contribute the missing data yourself. See the <a
href="http://wiki.openstreetmap.org/wiki/Getting_Involved">OSM Wiki</a> for a
start. {% endblocktrans %}{% endif %}
+
+ <a href="http://www.osm.org/?{% if job.administrative_city %}relation={{
job.administrative_osmid|abs }}{% else %}maxlat={{ job.lat_upper_left
}}&maxlon={{ job.lon_bottom_right }}&minlat={{ job.lat_bottom_right
}}&minlon={{ job.lon_upper_left }}{% endif %}">{% trans "View on
OpenStreetMap" %}</a>
+
+
{% else %}
{% if job.is_obsolete %}<p class="nofiles">{% trans "The generated files
are no longer available." %}</p>{% endif %}
{% endif %}
--
1.7.1