From e0b2b245fe00e6593db340b30754b80045eb9ac9 Mon Sep 17 00:00:00 2001 From: Elrond Date: Wed, 14 Mar 2012 20:13:42 +0100 Subject: [PATCH] Use .gps_* in the template and add translations. Instead of .gps.x use .gps_x and add some "is defined" and stuff. Also mark some strings for translation in here. --- .../mediagoblin/utils/geolocation_map.html | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/mediagoblin/templates/mediagoblin/utils/geolocation_map.html b/mediagoblin/templates/mediagoblin/utils/geolocation_map.html index 118d0e62..e8baa247 100644 --- a/mediagoblin/templates/mediagoblin/utils/geolocation_map.html +++ b/mediagoblin/templates/mediagoblin/utils/geolocation_map.html @@ -17,24 +17,27 @@ #} {% block geolocation_map %} - {% if media.media_data.has_key('gps') - and app_config['geolocation_map_visible'] - and media.media_data.gps %} -

Location

+ {% if app_config['geolocation_map_visible'] + and media.media_data.gps_latitude is defined + and media.media_data.gps_latitude + and media.media_data.gps_longitude is defined + and media.media_data.gps_longitude %} +

{% trans %}Location{% endtrans %}

- {% set gps = media.media_data.gps %} + {%- set lon = media.media_data.gps_longitude %} + {%- set lat = media.media_data.gps_latitude %} + {%- set osm_url = "http://openstreetmap.org/?mlat={lat}&mlon={lon}".format(lat=lat, lon=lon) %}
+ value="{{ lon }}" /> + value="{{ lat }}" />

- View on - - OpenStreetMap - + {% trans -%} + View on OpenStreetMap + {%- endtrans %}

-- 2.25.1