]> git.parisson.com Git - telemeta.git/commitdiff
Fix related media download
authorGuillaume Pellerin <yomguy@parisson.com>
Wed, 28 May 2014 13:06:52 +0000 (15:06 +0200)
committerGuillaume Pellerin <yomguy@parisson.com>
Wed, 28 May 2014 13:06:52 +0000 (15:06 +0200)
telemeta/templates/telemeta/inc/mediaitem_related.html
telemeta/templates/telemeta/inc/resource_related.html

index ce73caa772dd566f0c226e84b0e5c34eaa46c86c..51f58dcd99d5baecf7c65212aff0915147e2007f 100644 (file)
                                 <dt>{% trans "Credits" %}</dt>
                                 <dd>{{ media.credits }}</dd>
                                 {% dl_field media "mime_type" %}
+                                {% if media.file %}
                                 <dt>{% trans "Download" %}</dt>
                                 <dd>
-                                    {% if media.file %}
-                                        <a href="{% url telemeta-item-related-download item.public_id media.id %}" target="_blank">
-                                        {{ media.file|get_filename }}
+                                    <a href="{% url telemeta-item-related-download item.public_id media.id %}">
+                                     {{ media.file|get_filename }}
                                     </a>
-                                    {% endif %}
-                                {% endif %}
                                 </dd>
+                                {% endif %}
                             </dl>
                             </td>
 
index cbc819ee81fc5294449612cca2caf9717e37e487..8cd50fa192e3f23a0e521dffd3a255bc3a03f572 100644 (file)
                                 <dt>{% trans "Credits" %}</dt>
                                 <dd>{{ media.credits }}</dd>
                                 {% dl_field media "mime_type" %}
-                                <dt>{% trans "URL" %}</dt>
+                                {% if media.file %}
+                                <dt>{% trans "Download" %}</dt>
                                 <dd>
-                                {% if media.url %}
-                                    <a href="{{ media.url }}" target="_blank">{{ media.url }}</a>
-                                {% else %}
-                                    {% if media.file %}
-                                    <a href="{% url telemeta-resource-related type resource.code media.id %}" target="_blank">
-                                    {% url telemeta-resource-related type resource.code media.id %}
+                                    <a href="{% url telemeta-item-related-download item.public_id media.id %}">
+                                     {{ media.file|get_filename }}
                                     </a>
-                                    {% endif %}
-                                {% endif %}
                                 </dd>
+                                {% endif %}
                             </dl>
                             </td>