]> git.parisson.com Git - telemeta.git/commitdiff
display related media as dl fields
authoryomguy <yomguy@parisson.com>
Thu, 10 Nov 2011 12:52:36 +0000 (13:52 +0100)
committeryomguy <yomguy@parisson.com>
Thu, 10 Nov 2011 12:52:36 +0000 (13:52 +0100)
telemeta/templates/telemeta_default/mediaitem_detail.html
telemeta/templates/telemeta_default/mediaitem_detail_dc.html

index c2263c754f64d51600ac2a7e4c04a986160d019f..74ea26ecdd93a148745cfb3d784c7a762a8a2e66 100644 (file)
         <div>
             <h4><a href="#">{% trans "Related media" %}</a></h4>
             {% if related_files %}
-            <div class="instruments">
+            <div>
                 <table class="instruments" width="100%">
                     <thead>
                         <tr>
-                            <td>{% field_label "MediaItemRelated" "title" %}</td>
-                            <td>{% field_label "MediaItemRelated" "description" %}</td>
-                            <td>{% field_label "MediaItemRelated" "mime type" %}</td>
+                            <td>{% field_label "MediaItemRelated" "media" %}</td>
                             <td>{% field_label "MediaItemRelated" "preview" %}</td>
                         </tr>
                     </thead>
                     <tbody>
                         {% for file in related_files %}
                         <tr>
-                            <td>
-                            {% if file.url %}
-                               <a href="{{ file.url }}" target="_blank">
-                                {% if file.title %}
-                                 {{ file.title }}
-                                {% else %} 
-                                 {{ file.url|get_filename }}
-                                {% endif %}
-                                </a>
-                            {% endif %}
-                            {% if file.file %}
-                              <a href="{% url telemeta-item-related-file item.public_id file.id %}" target="_blank">
-                                {% if file.title %}
-                                 {{ file.title }}
-                                {% else %} 
-                                 {{ file.file|get_filename }}
+                            <td style="font-size: 1em;">
+                            <dl class="listing">
+                                <dt>{% trans "Title" %}</dt>
+                                <dd>
+                                    {% if file.url %}
+                                        <a href="{{ file.url }}" target="_blank">
+                                        {% if file.title %}
+                                            {{ file.title }}</a>
+                                        {% else %}
+                                            {{ file.url|get_filename }}</a>
+                                        {% endif %}
+                                    {% else %}
+                                        <a href="{% url telemeta-item-related-file item.public_id file.id %}" target="_blank">
+                                        {% if file.title %}
+                                            {{ file.title }}</a>
+                                        {% else %}
+                                            {{ file.file|get_filename }}</a>
+                                        {% endif %} 
+                                    {% endif %}
+                                </dd>
+                                <dt>{% trans "Description" %}</dt>
+                                <dd>{{ file.description|html_line_break|safe }}</dd>
+                                {% dl_field file "mime_type" %}
+                                <dt>{% trans "URL" %}</dt>
+                                <dd>
+                                {% if file.url %}
+                                    <a href="{{ file.url }}" target="_blank">{{ file.url }}</a>
+                                {% else %}
+                                    <a href="{% url telemeta-item-related-file item.public_id file.id %}" target="_blank">
+                                        {% url telemeta-item-related-file item.public_id file.id %}
+                                    </a>
                                 {% endif %}
-                              </a>
-                            {% endif %}
+                                </dd>
+                            </dl>
                             </td>
-                            <td>{{ file.description }}</td>
-                            <td>{{ file.mime_type }}</td>
+
                             <td>{% if file.is_image %}
                                   {% if file.url %}
                                    <a href="{{ file.url }}">
-                                   <img src="{{ file.url }}" style="max-width: 420px;" /></a>
+                                   <img src="{{ file.url }}" style="max-width: 420px; max-height: 200px;" /></a>
                                   {% else %}
                                    <a href="{% url telemeta-item-related-file item.public_id file.id %}">
-                                   <img src="{% url telemeta-item-related-file item.public_id file.id %}" style="max-width: 420px;" /></a>
+                                   <img src="{% url telemeta-item-related-file item.public_id file.id %}" style="max-width: 420px; max-height: 200px;" /></a>
                                    {% endif %}
                                 {% else %}
                                 {% if file.url %}
                                  {% if "youtube" in file.url %}
-                                 <iframe width="420" height="315" src="{{ file.url|get_youtube }}" frameborder="0" allowfullscreen></iframe>
-                                 {% else %}
-                                 <a href="{{ file.url }}">{% trans "link" %}</a>
+                                 <iframe width="251" height="200" src="{{ file.url|get_youtube }}" frameborder="0" allowfullscreen></iframe>
                                  {% endif %}
                                 {% endif %}
-                                {% if file.file %}
-                                <a href="{% url telemeta-item-related-file item.public_id file.id %}">link</a>
                                 {% endif %}
-                                {% endif %}</td>
+                            </td>
                         </tr>
                         {% endfor %}
                     </tbody>
index 0347be9c492d6e0ce27776d9516684db07c76fbb..d745dc6786d551ec6c19e3a9aeb2572821e03b5b 100644 (file)
@@ -1,19 +1,20 @@
-{% extends "telemeta/mediaitem_detail.html" %}\r
-{% load telemeta_utils %}\r
-{% load i18n %}\r
-\r
-{% if item %}\r
-{% block title_buttons %}\r
- <a class="component_icon button icon_previous" href="{% url telemeta-item-detail item.public_id %}">{% trans "Normal View" %}</a>\r
-{% endblock %}\r
-\r
-{% block infos %}\r
-{% with item|to_dublincore as resource %}\r
-{% include "telemeta/inc/dublincore.html" %}\r
-{% endwith %}\r
-{% endblock %}\r
-{% else %}\r
-    <p>{% trans "No such item" %}</p>\r
-{% endif %}\r
-\r
-\r
+{% extends "telemeta/mediaitem_detail.html" %}
+{% load telemeta_utils %}
+{% load i18n %}
+
+{% if item %}
+{% block title_buttons %}
+ <a class="component_icon button icon_previous" href="{% url telemeta-item-detail item.public_id %}">{% trans "Normal View" %}</a>
+{% endblock %}
+
+{% block infos %}
+{% with item|to_dublincore as resource %}
+{% include "telemeta/inc/dublincore.html" %}
+{% endwith %}
+{% endblock %}
+{% else %}
+    <p>{% trans "No such item" %}</p>
+{% endif %}
+
+{% block related %}
+{% endblock related %}