--- /dev/null
+{% extends "telemeta_default/collection_related_edit.html" %}
--- /dev/null
+{% extends "telemeta_default/inc/collection_related.html" %}
--- /dev/null
+{% extends "telemeta_default/inc/mediaitem_related.html" %}
--- /dev/null
+{% extends "telemeta/collection_detail.html" %}
+{% load i18n %}
+{% load telemeta_utils %}
+
+{% block extra_javascript %}{% endblock %}
+
+{% block title %}
+ <img src="{% url telemeta-images "item.png" %}" style="vertical-align:middle" /> Item : {{ item }}
+{% endblock %}
+
+{% block title_buttons %}
+ <a href="{% url telemeta-collection-detail collection.public_id %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
+{% endblock %}
+
+{% block content %}
+ {% block infos %}
+ <div class="infos">
+ <form enctype="multipart/form-data" method="post" id="_editMediaCollectionRelatedFileForm" action="">{% csrf_token %}
+
+ {{ formset.management_form }}
+ {% for form in formset.forms %}
+ <hr>
+ <table>
+ <tr><td><b>{% trans "Media" %} :</b><td></td></tr>
+ {% for field in form %}
+ <tr><td class="error">{{ field.errors }}</td></tr>
+ <tr>
+ {% if "media_collection" in field.html_name or "id" in field.html_name or "collection" in field.html_name or "mime_type" in field.html_name %}
+ <td>{{ field.label_tag.as_hidden }}</td><td>{{ field.as_hidden }}</td>
+ {% else %}
+ <td>{{ field.label_tag }}: </td><td>{{ field }}</td>
+ {% endif %}
+ </tr>
+ {% endfor %}
+ </table>
+ <br />
+ {% endfor %}
+ <div align="center">
+ <a href="{% url telemeta-collection-detail collection.public_id %}"
+ class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
+ <a href="#" class="component_icon button icon_save"
+ onclick="document.getElementById('_editMediaCollectionRelatedFileForm').submit(); return false;">{% trans "Save" %}</a>
+ </div>
+ </form>
+ </div>
+ {% endblock infos %}
+{% endblock content %}
--- /dev/null
+{% load i18n %}
+{% load telemeta_utils %}
+
+ <div>
+ <h4><a href="#">{% trans "Related media" %}</a></h4>
+ {% if related_media %}
+ <div>
+ <table class="instruments" width="100%">
+ <thead>
+ <tr>
+ <td>{% trans "Media" %}</td>
+ <td>{% trans "Preview" %}</td>
+ </tr>
+ </thead>
+ <tbody>
+ {% for media in related_media %}
+ <tr>
+ <td style="font-size: 1em;">
+ <dl class="listing">
+ <dt>{% trans "Title" %}</dt>
+ <dd>
+ {% if media.url %}
+ <a href="{{ media.url }}" target="_blank">
+ {% if media.title %}
+ {{ media.title }}</a>
+ {% else %}
+ {{ media.url|get_filename }}</a>
+ {% endif %}
+ {% else %}
+ <a href="{% url telemeta-collection-related collection.public_id media.id %}" target="_blank">
+ {% if media.title %}
+ {{ media.title }}</a>
+ {% else %}
+ {{ media.file|get_filename }}</a>
+ {% endif %}
+ {% endif %}
+ </dd>
+ <dt>{% trans "Description" %}</dt>
+ <dd>{{ media.description|html_line_break|safe }}</dd>
+ <dt>{% trans "Credits" %}</dt>
+ <dd>{{ media.credits }}</dd>
+ {% dl_field media "mime_type" %}
+ <dt>{% trans "URL" %}</dt>
+ <dd>
+ {% if media.url %}
+ <a href="{{ media.url }}" target="_blank">{{ media.url }}</a>
+ {% else %}
+ {% if media.file %}
+ <a href="{% url telemeta-collection-related collection.public_id media.id %}" target="_blank">
+ {% url telemeta-collection-related collection.public_id media.id %}
+ </a>
+ {% endif %}
+ {% endif %}
+ </dd>
+ </dl>
+ </td>
+
+ <td style="padding-bottom: 1em;">{% if media.is_image %}
+ {% if media.url %}
+ <a href="{{ media.url }}">
+ <img src="{{ media.url }}" style="max-width: 420px; max-height: 200px;" /></a>
+ {% else %}
+ <a href="{% url telemeta-collection-related collection.public_id media.id %}">
+ <img src="{% url telemeta-collection-related collection.public_id media.id %}" style="max-width: 420px; max-height: 200px;" /></a>
+ {% endif %}
+ {% else %}
+ {% if media.url %}
+ {% if "youtu" in media.url %}
+ <iframe width="251" height="200" src="{{ media.url|get_youtube }}" frameborder="0" allowfullscreen></iframe>
+ {% endif %}
+ {% endif %}
+ {% endif %}
+ </td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ </div>
+ {% endif %}
+ {% if user.is_authenticated and perms.telemeta.change_mediacollection %}
+ <br /><a href="{% url telemeta-collection-related_edit collection.public_id %}" class="component_icon button icon_edit">{% trans "Edit"%} {% trans "related media"%}</a>
+ {% endif %}
+ </div>
--- /dev/null
+{% load i18n %}
+{% load telemeta_utils %}
+
+ <div>
+ <h4><a href="#">{% trans "Related media" %}</a></h4>
+ {% if related_media %}
+ <div>
+ <table class="instruments" width="100%">
+ <thead>
+ <tr>
+ <td>{% trans "Media" %}</td>
+ <td>{% trans "Preview" %}</td>
+ </tr>
+ </thead>
+ <tbody>
+ {% for media in related_media %}
+ <tr>
+ <td style="font-size: 1em;">
+ <dl class="listing">
+ <dt>{% trans "Title" %}</dt>
+ <dd>
+ {% if media.url %}
+ <a href="{{ media.url }}" target="_blank">
+ {% if media.title %}
+ {{ media.title }}</a>
+ {% else %}
+ {{ media.url|get_filename }}</a>
+ {% endif %}
+ {% else %}
+ <a href="{% url telemeta-item-related item.public_id media.id %}" target="_blank">
+ {% if media.title %}
+ {{ media.title }}</a>
+ {% else %}
+ {{ media.file|get_filename }}</a>
+ {% endif %}
+ {% endif %}
+ </dd>
+ <dt>{% trans "Description" %}</dt>
+ <dd>{{ media.description|html_line_break|safe }}</dd>
+ <dt>{% trans "Credits" %}</dt>
+ <dd>{{ media.credits }}</dd>
+ {% dl_field media "mime_type" %}
+ <dt>{% trans "URL" %}</dt>
+ <dd>
+ {% if media.url %}
+ <a href="{{ media.url }}" target="_blank">{{ media.url }}</a>
+ {% else %}
+ {% if media.file %}
+ <a href="{% url telemeta-item-related item.public_id media.id %}" target="_blank">
+ {% url telemeta-item-related item.public_id media.id %}
+ </a>
+ {% endif %}
+ {% endif %}
+ </dd>
+ </dl>
+ </td>
+
+ <td style="padding-bottom: 1em;">{% if media.is_image %}
+ {% if media.url %}
+ <a href="{{ media.url }}">
+ <img src="{{ media.url }}" style="max-width: 420px; max-height: 200px;" /></a>
+ {% else %}
+ <a href="{% url telemeta-item-related item.public_id media.id %}">
+ <img src="{% url telemeta-item-related item.public_id media.id %}" style="max-width: 420px; max-height: 200px;" /></a>
+ {% endif %}
+ {% else %}
+ {% if media.url %}
+ {% if "youtu" in media.url %}
+ <iframe width="251" height="200" src="{{ media.url|get_youtube }}" frameborder="0" allowfullscreen></iframe>
+ {% endif %}
+ {% endif %}
+ {% endif %}
+ </td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ </div>
+ {% endif %}
+ {% if user.is_authenticated and perms.telemeta.change_mediaitem %}
+ <br /><a href="{% url telemeta-item-related_edit item.public_id %}" class="component_icon button icon_edit">{% trans "Edit"%} {% trans "related media"%}</a>
+ {% endif %}
+ </div>