modified: app.py modified: templates/list_media.html.j2 modified: templates/user_media.html.j2 modified: templates/view_media_details.html.j2
24 lines
1.1 KiB
Django/Jinja
24 lines
1.1 KiB
Django/Jinja
{% extends 'base.html.j2' %}
|
|
|
|
{% block title %}Media Details{% endblock %}
|
|
|
|
{% block content %}
|
|
<h1>Media Details</h1>
|
|
|
|
<p><strong>Title:</strong> {{ media.title if media.title else 'Untitled' }}</p>
|
|
<p><strong>Filename:</strong> {{ media.filename }}</p>
|
|
<p><strong>Uploaded by:</strong> <a href="{{ request.route_url('user_media', user_short_id=user_short_id) }}">{{ username }}</a></p>
|
|
<p><strong>Upload Date:</strong> {{ media.upload_date.strftime('%Y-%m-%d %H:%M:%S') }}</p>
|
|
<p><strong>Status:</strong> {{ 'Public' if media.is_public else 'Private' }}</p>
|
|
<p><strong>Size:</strong> {{ media.size | filesizeformat }}</p>
|
|
|
|
<!-- View and Download links -->
|
|
<a href="{{ request.route_url('view_media', user_short_id=user_short_id, media_short_id=media.short_id) }}">View</a> |
|
|
<a href="{{ request.route_url('view_media', user_short_id=user_short_id, media_short_id=media.short_id, _query={'download': 'true'}) }}">Download</a>
|
|
|
|
{% if is_owner %}
|
|
<!-- Edit button for the owner -->
|
|
| <a href="{{ request.route_url('edit_media', user_short_id=user_short_id, media_short_id=media.short_id) }}">Edit</a>
|
|
{% endif %}
|
|
|
|
{% endblock %}
|