From 1c2d01ae3ba421536d5775e5992393019714b856 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Fri, 25 Jan 2013 10:39:20 -0600 Subject: Very start of plugin hooks and openstreetmap pluginification - Added start of template hook code to pluginapi.py - Started to break openstreetmap into plugin; moved templates - Added plugin hooks in media and image media templates ... almost certainly, none of this works yet. :) --- .../mediagoblin/media_displays/image.html | 8 +++ .../templates/mediagoblin/user_pages/media.html | 14 ++--- .../mediagoblin/utils/geolocation_map.html | 60 ---------------------- 3 files changed, 13 insertions(+), 69 deletions(-) delete mode 100644 mediagoblin/templates/mediagoblin/utils/geolocation_map.html (limited to 'mediagoblin/templates') diff --git a/mediagoblin/templates/mediagoblin/media_displays/image.html b/mediagoblin/templates/mediagoblin/media_displays/image.html index 30c2a90d..b03cfc78 100644 --- a/mediagoblin/templates/mediagoblin/media_displays/image.html +++ b/mediagoblin/templates/mediagoblin/media_displays/image.html @@ -18,5 +18,13 @@ {% extends 'mediagoblin/user_pages/media.html' %} +{% from "/mediagoblin/utils/templatehooks.html" import template_hook %} + +{% block mediagoblin_head %} + {{ super() }} + {% template_hook "image_extrahead" %} +{% endblock mediagoblin_head %} + {% block mediagoblin_sidebar %} + {% template_hook "image_sideinfo" %} {% endblock %} diff --git a/mediagoblin/templates/mediagoblin/user_pages/media.html b/mediagoblin/templates/mediagoblin/user_pages/media.html index 7e184257..b18e0828 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/media.html +++ b/mediagoblin/templates/mediagoblin/user_pages/media.html @@ -18,6 +18,7 @@ {% extends "mediagoblin/base.html" %} {% import "/mediagoblin/utils/wtforms.html" as wtforms_util %} +{% from "/mediagoblin/utils/templatehooks.html" import template_hook %} {% from "mediagoblin/utils/pagination.html" import render_pagination %} {% block title %}{{ media.title }} — {{ super() }}{% endblock %} @@ -30,15 +31,7 @@ - {% if app_config['geolocation_map_visible'] %} - - - - - {% endif %} + {% template_hook "media_extrahead" %} {% endblock mediagoblin_head %} {% block mediagoblin_content %} @@ -206,8 +199,11 @@

{% endif %} + {% template_hook "media_sideinfo" %} + {% block mediagoblin_sidebar %} {% endblock %} +
{% endblock %} diff --git a/mediagoblin/templates/mediagoblin/utils/geolocation_map.html b/mediagoblin/templates/mediagoblin/utils/geolocation_map.html deleted file mode 100644 index b48678bb..00000000 --- a/mediagoblin/templates/mediagoblin/utils/geolocation_map.html +++ /dev/null @@ -1,60 +0,0 @@ -{# -# GNU MediaGoblin -- federated, autonomous media hosting -# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS. -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -#} - -{% block geolocation_map %} - {% 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 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) %} -
- - -
- - -

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

-
- {% endif %} -{% endblock %} -- cgit v1.2.3