{# Properties page for a single ir.attachment.
Renders in two modes:
* Full page (default) — wraps in the standard sidebar layout.
* Panel fragment (is_panel=True) — used by the Library's right-side
slide-over. Skips the layout, omits the page heading, and lays the
preview + metadata vertically so it fits a narrow column.
Context variables (set by the route handler):
att ir.attachment record (already permission-checked)
mimetype lowercased att.mimetype
is_image bool — image MIME → render preview
extension derived from datas_fname / name (lowercase, no dot)
dimensions (w, h) tuple or None — only computed for images
owner_url /web/records/.../ link or "" when no owner
folder_chain [{id, name}, …] root → leaf, or []
panel_only bool — skip the page chrome
#}
{% if not panel_only %}{% extends "layouts/main.html" %}{% endif %}
{% if not panel_only %}
{% block title %}{{ att.name }} — {% if brand is defined %}{{ brand.app_name }}{% else %}pyvelm{% endif %}{% endblock %}
{% block page_title %}{{ att.name }}{% endblock %}
{% block page_actions %}
Download
{% if owner_url %}
Open linked record
{% endif %}
{% endblock %}
{% endif %}
{% if panel_only %}
{% set body_class = "space-y-3" %}
{% else %}
{% set body_class = "grid gap-6 grid-cols-1 lg:grid-cols-[minmax(0,1fr)_28rem]" %}
{% endif %}
{% set body %}