aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2011-08-21 23:39:59 -0500
committerChristopher Allan Webber <cwebber@dustycloud.org>2011-08-21 23:39:59 -0500
commit9b424b17ccb6b6c034755925b14f9cfda23ad29a (patch)
treee697474b3037fa6397b2a6fcdc8d171f24cd71d3
parent970cea18dcdbfd68ad5506843504decd6826122b (diff)
downloadmediagoblin-9b424b17ccb6b6c034755925b14f9cfda23ad29a.tar.lz
mediagoblin-9b424b17ccb6b6c034755925b14f9cfda23ad29a.tar.xz
mediagoblin-9b424b17ccb6b6c034755925b14f9cfda23ad29a.zip
Feature #506: link to original sized image if we scaled the image down.
-rw-r--r--mediagoblin/templates/mediagoblin/user_pages/media.html21
1 files changed, 18 insertions, 3 deletions
diff --git a/mediagoblin/templates/mediagoblin/user_pages/media.html b/mediagoblin/templates/mediagoblin/user_pages/media.html
index 2086d3d6..6747fddc 100644
--- a/mediagoblin/templates/mediagoblin/user_pages/media.html
+++ b/mediagoblin/templates/mediagoblin/user_pages/media.html
@@ -24,9 +24,24 @@
{% if media %}
<div class="grid_11 alpha">
<div class="media_image_container">
- <img class="media_image"
- src="{{ request.app.public_store.file_url(
- media.get_display_media(media.media_files)) }}" />
+ {% set display_media = request.app.public_store.file_url(
+ media.get_display_media(media.media_files)) %}
+
+ {# if there's a medium file size, that means the medium size
+ # isn't the original... so link to the original!
+ #}
+ {% if media['media_files'].has_key('medium') %}
+ <a href="{{ request.app.public_store.file_url(
+ media['media_files']['original']) }}">
+ <img class="media_image"
+ src="{{ display_media }}"
+ alt="Image for {{ media.title }}" />
+ </a>
+ {% else %}
+ <img class="media_image"
+ src="{{ display_media }}"
+ alt="Image for {{ media.title }}" />
+ {% endif %}
</div>
<h2 class="media_title">