From fd79d33a877c97a26706931bdf0988469ad37504 Mon Sep 17 00:00:00 2001 From: Sebastian Spaeth Date: Wed, 14 Nov 2012 10:12:58 +0100 Subject: [PATCH 1/2] Pop up OpenStreetMap license on demand (#410) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Only a short blurb "see map license" in the small map which will pop up the full license text via jquery when clicked. Adapt the license text as recommended by OpenStreetMap http://www.openstreetmap.org/copyright and link there. The disadvantage is that this only works when Javascript is enabled, but as the map only works when Javascript is enabled in the first place, this should not be too much of a limitation. TODO: Our esteemed web designer needs to have a look at the desired color style for this. Right now, I simply placed it in the message_warning class. This might want fine-tuning. Signed-off-by: Sebastian Spaeth --- mediagoblin/static/css/base.css | 4 ++++ mediagoblin/static/js/geolocation-map.js | 10 +++------- .../mediagoblin/utils/geolocation_map.html | 15 +++++++++++++++ 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/mediagoblin/static/css/base.css b/mediagoblin/static/css/base.css index 4120f965..f8a9e014 100644 --- a/mediagoblin/static/css/base.css +++ b/mediagoblin/static/css/base.css @@ -259,6 +259,10 @@ text-align: center; height: 0; } +.hidden { + display: none; +} + .media_sidebar h3 { font-size: 1em; margin: 0 0 5px; diff --git a/mediagoblin/static/js/geolocation-map.js b/mediagoblin/static/js/geolocation-map.js index de49a37d..26d94c5d 100644 --- a/mediagoblin/static/js/geolocation-map.js +++ b/mediagoblin/static/js/geolocation-map.js @@ -31,19 +31,15 @@ $(document).ready(function () { var map = new L.Map('tile-map'); var mqtileUrl = 'http://otile{s}.mqcdn.com/tiles/1.0.0/osm/{z}/{x}/{y}.jpg'; - var mqtileAttrib = 'Map data © ' - + String(new Date().getFullYear()) - + ' OpenStreetMap contributors, CC-BY-SA.' - + ' Imaging © ' - + String(new Date().getFullYear()) - + ' MapQuest.'; + var mqtileAttrib = 'see map license'; var mqtile = new L.TileLayer( mqtileUrl, {maxZoom: 18, attribution: mqtileAttrib, subdomains: '1234'}); - var location = new L.LatLng(latitude, longitude); + map.attributionControl.setPrefix(''); + var location = new L.LatLng(latitude, longitude); map.setView(location, 13).addLayer(mqtile); var marker = new L.Marker(location); diff --git a/mediagoblin/templates/mediagoblin/utils/geolocation_map.html b/mediagoblin/templates/mediagoblin/utils/geolocation_map.html index cd57d1f8..b48678bb 100644 --- a/mediagoblin/templates/mediagoblin/utils/geolocation_map.html +++ b/mediagoblin/templates/mediagoblin/utils/geolocation_map.html @@ -33,6 +33,21 @@ + +

{% trans -%} From ee97ac6c2f8629aee958391f1f6337b1983529d0 Mon Sep 17 00:00:00 2001 From: Sebastian Spaeth Date: Wed, 14 Nov 2012 20:31:03 +0100 Subject: [PATCH 2/2] Add geolocation_visible setting to mediagoblin.ini MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Place the geolocation_visible setting (defaults to false) in mediagoblin.ini to make it more discoverable (I needed to check the source to find out how to enable it). I'd vote for a default of true, we should come with some batteries included IMHO.. Signed-off-by: Sebastian Spaeth --- mediagoblin.ini | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mediagoblin.ini b/mediagoblin.ini index f10a452f..b6a13f31 100644 --- a/mediagoblin.ini +++ b/mediagoblin.ini @@ -27,6 +27,9 @@ allow_registration = true ## install other themes. # theme = airy +# Should geotagged images be displayed with a map of the location? +geolocation_map_visible = false + [storage:queuestore] base_dir = %(here)s/user_dev/media/queue