upload.unturf.com/templates/view_media_details.html.j2

79 lines
4.1 KiB
Django/Jinja

<!-- view_media_details.html.j2 -->
{% 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>Visibility:</strong> {{ media.visibility|title }}</p>
{% if scheduled_actions %}
<h2>Scheduled Actions</h2>
<ul>
{% for action in scheduled_actions %}
<li>
{{ action.action_type.replace('set_', '').replace('_', ' ')|title }} - {{ action.scheduled_date.strftime('%Y-%m-%d %H:%M:%S') }} ({{ action.status }})
{% if is_owner_or_editor %}
| <a href="{{ request.route_url('edit_scheduled_action', namespace_short_id=namespace.short_id, media_short_id=media.short_id, action_id=action.id) }}">Edit</a>
| <form method="POST" action="{{ request.route_url('delete_scheduled_action', namespace_short_id=namespace.short_id, media_short_id=media.short_id, action_id=action.id) }}" class="inline-form" onsubmit="return confirm('Delete this scheduled action?');">
<input type="hidden" name="csrf_token" value="{{ request.session.get_csrf_token() }}">
<button type="submit" class="link-button">Delete</button>
</form>
{% endif %}
</li>
{% endfor %}
</ul>
{% if is_owner_or_editor %}
<p><a href="{{ request.route_url('add_scheduled_action', namespace_short_id=namespace.short_id, media_short_id=media.short_id) }}">Add Scheduled Action</a></p>
{% endif %}
{% else %}
{% if is_owner_or_editor %}
<h2>Scheduled Actions</h2>
<p>No scheduled actions for this media.</p>
<p><a href="{{ request.route_url('add_scheduled_action', namespace_short_id=namespace.short_id, media_short_id=media.short_id) }}">Add Scheduled Action</a></p>
{% endif %}
{% endif %}
{% if ascii_preview %}
<h2>Text Preview (First 100 lines)</h2>
<pre style="background: #f5f5f5; padding: 1em; border-radius: 4px; overflow-x: auto;">{{ ascii_preview }}</pre>
{% endif %}
<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) }}">View</a>
| <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 %}