{% extends "base.html" %} {% block title %}— {{ defn.filename }}{% endblock %} {% block content %} {# ── breadcrumb + header ── #}
Datasets › {{ defn.file_id }}

{{ defn.filename }}

{# encoding badge #} {% set enc_colors = { "csv": "bg-emerald-100 text-emerald-800", "json": "bg-blue-100 text-blue-800", "hf-json": "bg-blue-100 text-blue-800", "text": "bg-slate-100 text-slate-700", "pickle": "bg-purple-100 text-purple-800", "pandas": "bg-purple-100 text-purple-800", } %} {{ defn.encoding }} {# file status badge #} {% if file_exists %} ✓ File found {% else %} ✗ File missing {% endif %} {% if file_size is not none %} {{ (file_size / 1024) | round(1) }} KB {% endif %}

{{ defn.path }}

{# ── flash ── #}
{# ── metadata + edit grid ── #}
{# metadata card #}

Metadata

ID
{{ defn.file_id }}
Filename
{{ defn.filename }}
Path
{{ defn.path }}
Encoding
{{ defn.encoding }}
Tags
{% if defn.tags %} {% for tag in defn.tags %} {{ tag }} {% endfor %} {% else %} — {% endif %}
{% if defn.description %}
Description
{{ defn.description }}
{% endif %} {% if defn.extended_metadata %}
Extended metadata
{{ defn.extended_metadata | tojson(indent=2) }}
{% endif %}
{# actions + edit card #}
{# download / retire actions #}

Actions

{% if file_exists %} Download {% endif %}
{# edit form #}

Edit metadata

Changing the ID may break references in code or configs.

{# ── preview ── #} {% if preview_type == 'csv' %}

Preview

{% if truncated %} First {{ csv_rows | length }} rows {% else %} {{ csv_rows | length }} rows {% endif %}
{% if csv_headers %} {% for col in csv_headers %} {% endfor %} {% endif %} {% for row in csv_rows %} {% for cell in row %} {% endfor %} {% endfor %} {% if not csv_rows %} {% endif %}
{{ col }}
{{ cell }}
No data rows found.
{% if truncated %}
File contains more rows — download to view complete data.
{% endif %}
{% elif preview_type == 'text' %}

Preview

{% if truncated %} First 50 lines {% endif %}
{{ text_content }}
{% if truncated %}
File contains more lines — download to view complete content.
{% endif %}
{% elif preview_type == 'missing' %}

File not found on disk

{{ defn.path }}/{{ defn.filename }}

{% elif preview_type == 'error' %}

Could not read file

{% if preview_error %}

{{ preview_error }}

{% endif %}
{% else %}

No preview available for this format ({{ defn.encoding }}).

{% if file_exists %}

Use the download button to open the file.

{% endif %}
{% endif %} {% endblock %}