45 lines
2.3 KiB
Django/Jinja
45 lines
2.3 KiB
Django/Jinja
{% extends 'base.html.j2' %}
|
|
|
|
{% block title %}Media Details{% endblock %}
|
|
|
|
{% block content %}
|
|
<h1>Media Details</h1>
|
|
<p><strong>Title:</strong> {{ media.title or 'Untitled' }}</p>
|
|
<p><strong>Filename:</strong> {{ media.filename }}</p>
|
|
<p><strong>Type:</strong> {{ media.media_type }}</p>
|
|
<p><strong>Size:</strong> {{ media.size|filesizeformat }}</p>
|
|
<p><strong>Uploaded:</strong> {{ media.upload_date.strftime('%Y-%m-%d %H:%M:%S') }}</p>
|
|
<p><strong>Public:</strong> {{ 'Yes' if media.is_public else 'No' }}</p>
|
|
|
|
<h2>Preview</h2>
|
|
{% if media.media_type == 'image' %}
|
|
<img src="{{ request.route_url('view_media', namespace_short_id=namespace.short_id, media_short_id=media.short_id) }}" alt="{{ media.title }}" style="max-width: 100%;">
|
|
{% elif media.media_type == 'audio' %}
|
|
<audio controls>
|
|
<source src="{{ request.route_url('view_media', namespace_short_id=namespace.short_id, media_short_id=media.short_id) }}" type="{{ media.media_type }}">
|
|
Your browser does not support the audio element.
|
|
</audio>
|
|
{% elif media.media_type == 'video' %}
|
|
<video controls style="max-width: 100%;">
|
|
<source src="{{ request.route_url('view_media', namespace_short_id=namespace.short_id, media_short_id=media.short_id) }}" type="{{ media.media_type }}">
|
|
Your browser does not support the video element.
|
|
</video>
|
|
{% else %}
|
|
<p>No preview available.</p>
|
|
{% endif %}
|
|
|
|
<h2>Actions</h2>
|
|
<p>
|
|
<a href="{{ request.route_url('view_media', namespace_short_id=namespace.short_id, media_short_id=media.short_id) }}?download=true">Download</a>
|
|
{% if is_owner_or_editor %}
|
|
| <a href="{{ request.route_url('edit_media', namespace_short_id=namespace.short_id, media_short_id=media.short_id) }}">Edit</a>
|
|
| <form method="POST" action="{{ request.route_url('delete_media', namespace_short_id=namespace.short_id, media_short_id=media.short_id) }}" class="inline-form" onsubmit="return confirm('Are you sure you want to delete this media?');">
|
|
<input type="hidden" name="csrf_token" value="{{ request.session.get_csrf_token() }}">
|
|
<button type="submit" class="link-button">Delete</button>
|
|
</form>
|
|
{% endif %}
|
|
</p>
|
|
|
|
<p><a href="{{ request.route_url('list_media', namespace_short_id=namespace.short_id) }}">Back to Media List</a></p>
|
|
|
|
{% endblock %}
|