{% comment %} The detail panel, swapped into #media-detail. Every mutation here returns a 204 with a `mediaChanged` event, so the grid refreshes itself and this panel does not have to know it exists. {% endcomment %} {% load media_library %}

{{ asset.title|default:asset.filename }}

{% if asset.is_image and asset.thumbnail %} {{ asset.alt_text }} {% endif %}
Type
{{ asset.get_kind_display }} · {{ asset.mime }}
Size
{{ asset.size_display }}
{% if asset.width %}
Dimensions
{{ asset.width }} × {{ asset.height }}
{% endif %}
Uploaded
{{ asset.created_at|date:"j M Y" }}{% if asset.uploaded_by %} by {{ asset.uploaded_by.display_name }}{% endif %}
Media id
{{ asset.id }}
{% comment %} The delivery URL is shown because it is the thing an operator debugging a send needs, and it is safe to show: it is signed, unguessable, and revoked by deleting the asset. {% endcomment %}

{% media_url asset %}

{% if can_manage %} {% comment %} hx-swap="none" on all three: they answer 204 and carry their result in HX-Trigger. Without it htmx swaps the response into the form itself, so an unexpected body — a session-expiry redirect to the login page, say — is injected into the panel. {% endcomment %}

Described to people using a screen reader, and sent to platforms that support it.

{% endif %}