Feature #506: link to original sized image if we scaled the image down.

This commit is contained in:
Christopher Allan Webber 2011-08-21 23:39:59 -05:00
parent 970cea18dc
commit 9b424b17cc

View File

@ -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">