{% 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">