{# partials/detail_field.html — render a single read-only field value.
Expects `field` (FieldRenderContext) in context.
#}
{{ 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 %}