aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/templates
diff options
context:
space:
mode:
authorJessica Tallon <jessica@megworld.co.uk>2014-10-09 19:20:13 +0100
committerJessica Tallon <jessica@megworld.co.uk>2014-10-09 19:20:13 +0100
commited48454558a91961b6e03fc51b8a4bf785d48d1e (patch)
tree792294c842fe5643a2d8f66be366805f621d4ece /mediagoblin/templates
parent9a1fc423ac298c2ddf078d91ea1302c135285781 (diff)
parentc0434db46910e891313495b5ae94cbbe1dd08058 (diff)
downloadmediagoblin-ed48454558a91961b6e03fc51b8a4bf785d48d1e.tar.lz
mediagoblin-ed48454558a91961b6e03fc51b8a4bf785d48d1e.tar.xz
mediagoblin-ed48454558a91961b6e03fc51b8a4bf785d48d1e.zip
Merge branch 'location'
Add Location model which holds textual, geolocation coordiantes or postal addresses. This migrates data off Image model metadata onto the general Location model. It also adds the ability for location to be set on MediaEntry, User, MediaComment and Collection models. The geolocation plugin has been updated so that the location can be displayed in more general places rather than explicitely on the MediaEntry view. If GPS coordiantes are set for the User the profile page will also have the OSM provided by the geolocation plugin.
Diffstat (limited to 'mediagoblin/templates')
-rw-r--r--mediagoblin/templates/mediagoblin/user_pages/media.html3
-rw-r--r--mediagoblin/templates/mediagoblin/user_pages/user.html2
-rw-r--r--mediagoblin/templates/mediagoblin/utils/profile.html12
3 files changed, 16 insertions, 1 deletions
diff --git a/mediagoblin/templates/mediagoblin/user_pages/media.html b/mediagoblin/templates/mediagoblin/user_pages/media.html
index 0b2ae898..a4b42211 100644
--- a/mediagoblin/templates/mediagoblin/user_pages/media.html
+++ b/mediagoblin/templates/mediagoblin/user_pages/media.html
@@ -30,6 +30,7 @@
<script type="text/javascript"
src="{{ request.staticdirect('/js/keyboard_navigation.js') }}"></script>
+ {% template_hook("location_head") %}
{% template_hook("media_head") %}
{% endblock mediagoblin_head %}
{% block mediagoblin_content %}
@@ -231,6 +232,8 @@
{% block mediagoblin_sidebar %}
{% endblock %}
+ {%- set model = media %}
+ {% template_hook("location_info") %}
{% template_hook("media_sideinfo") %}
</div><!--end media_sidebar-->
diff --git a/mediagoblin/templates/mediagoblin/user_pages/user.html b/mediagoblin/templates/mediagoblin/user_pages/user.html
index 51baa9bb..9ac96f80 100644
--- a/mediagoblin/templates/mediagoblin/user_pages/user.html
+++ b/mediagoblin/templates/mediagoblin/user_pages/user.html
@@ -46,7 +46,7 @@
{%- trans username=user.username %}{{ username }}'s profile{% endtrans -%}
</h1>
- {% if not user.url and not user.bio %}
+ {% if not user.url and not user.bio and not user.location %}
{% if request.user and (request.user.id == user.id) %}
<div class="profile_sidebar empty_space">
<p>
diff --git a/mediagoblin/templates/mediagoblin/utils/profile.html b/mediagoblin/templates/mediagoblin/utils/profile.html
index 7a3af01c..5cc38487 100644
--- a/mediagoblin/templates/mediagoblin/utils/profile.html
+++ b/mediagoblin/templates/mediagoblin/utils/profile.html
@@ -16,6 +16,10 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#}
+{% block mediagoblin_head %}
+ {% template_hook("location_head") %}
+{% endblock mediagoblin_head %}
+
{% block profile_content -%}
{% if user.bio %}
{% autoescape False %}
@@ -27,4 +31,12 @@
<a href="{{ user.url }}">{{ user.url }}</a>
</p>
{% endif %}
+ {% if user.location %}
+ {%- set model = user %}
+ <h3>{% trans %}Location{% endtrans %}</h3>
+ {% if model.get_location.name %}
+ <p>{{ model.get_location.name }}</p>
+ {% endif %}
+ {% template_hook("location_info") %}
+ {% endif %}
{% endblock %}