{# pages/detail.html — read-only detail view for a single object #} {% extends "base.html" %} {% block title %}{{ registered.verbose_name }} #{{ obj.id }} — {{ title | default("Admin") }}{% endblock %} {% block breadcrumb %} {{ super() }} / {{ registered.verbose_name_plural }} / {{ obj }} {% endblock %} {% block content %}
{% if fieldsets %} {% for fieldset in fieldsets %}

{{ fieldset.title or "Details" }}

{% for field in fieldset.fields %}
{{ field.meta.label }}
{% set val = field.widget_context.value | default(none) %} {% if val is none %} - {% elif field.widget_macro == 'toggle' %} {% if val %} {{ icon("check-circle", size="14px") }} Active {% else %} {{ icon("x-circle", size="14px") }} Inactive {% endif %} {% elif field.widget_macro == 'select' %} {% set choices = field.widget_context.choices | default([]) %} {% set found = false %} {% for choice in choices %} {% if choice[0] | string == val | string %} {{ choice[1] }} {% set found = true %} {% endif %} {% endfor %} {% if not found and val %}{{ val }}{% endif %} {% elif field.widget_macro == 'image_upload' and val %} {% elif field.widget_macro == 'file_upload' and val %} {{ val }} {% elif field.widget_macro == 'json_editor' %}
{{ val }}
{% elif field.widget_macro == 'color_picker' %}
{{ val }}
{% elif field.widget_macro == 'relation_picker' %} {{ field.widget_context.label_text | default(val) }} {% elif field.widget_macro == 'tag_input' %} {% set tags = val | default('[]') %} {% if tags is string %} {% set tags = tags | tojson %} {% endif %}
{% for tag in tags %} {{ tag }} {% endfor %}
{% else %} {{ val }} {% endif %}
{% endfor %}
{% endfor %} {% else %}

Details

{% for field in form_fields %}
{{ field.meta.label }}
{% set val = field.widget_context.value | default(none) %} {% if val is none %} - {% elif field.widget_macro == 'toggle' %} {% if val %} {{ icon("check-circle", size="14px") }} Active {% else %} {{ icon("x-circle", size="14px") }} Inactive {% endif %} {% elif field.widget_macro == 'select' %} {% set choices = field.widget_context.choices | default([]) %} {% set found = false %} {% for choice in choices %} {% if choice[0] | string == val | string %} {{ choice[1] }} {% set found = true %} {% endif %} {% endfor %} {% if not found and val %}{{ val }}{% endif %} {% elif field.widget_macro == 'image_upload' and val %} {% elif field.widget_macro == 'file_upload' and val %} {{ val }} {% elif field.widget_macro == 'json_editor' %}
{{ val }}
{% elif field.widget_macro == 'color_picker' %}
{{ val }}
{% elif field.widget_macro == 'relation_picker' %} {{ field.widget_context.label_text | default(val) }} {% elif field.widget_macro == 'tag_input' %} {% set tags = val | default('[]') %} {% if tags is string %} {% set tags = tags | tojson %} {% endif %}
{% for tag in tags %} {{ tag }} {% endfor %}
{% else %} {{ val }} {% endif %}
{% endfor %}
{% endif %} {% endblock %}