{% extends "base.html" %} {% block title %}Preview — {{ template.name }}{% endblock %} {% block extra_css %} {% endblock %} {% block content %}

{{ template.name }}

{{ template.description or 'Inspection form preview' }}
{{ template.frequency|title }}
This is a read-only preview. Layout matches the grid editor exactly.
{% if form_fields %}
{% for field in form_fields %}
{% if field.type == 'section' %}
{{ field.label }}
{% elif field.type == 'text' %} {% if field.help_text %}
{{ field.help_text }}
{% endif %} {% elif field.type == 'textarea' %} {% if field.help_text %}
{{ field.help_text }}
{% endif %} {% elif field.type == 'number' %} {% if field.help_text %}
{{ field.help_text }}
{% endif %} {% elif field.type == 'date' %} {% if field.help_text %}
{{ field.help_text }}
{% endif %} {% elif field.type == 'email' %} {% if field.help_text %}
{{ field.help_text }}
{% endif %} {% elif field.type == 'checkbox' %}
{% if field.help_text %}
{{ field.help_text }}
{% endif %} {% elif field.type == 'checkbox_group' %} {% for opt in field.options %}
{% endfor %} {% if field.help_text %}
{{ field.help_text }}
{% endif %} {% elif field.type == 'radio' %} {% for opt in field.options %}
{% endfor %} {% if field.help_text %}
{{ field.help_text }}
{% endif %} {% elif field.type == 'pass_fail' %} {% set pf_options = field.options if field.options else ['Pass', 'Fail'] %}
{% for opt in pf_options %} {% set is_pass = opt.lower() in ('pass','yes','ok','good') %} {{ opt }} {% endfor %}
{% if field.help_text %}
{{ field.help_text }}
{% endif %} {% elif field.type == 'select' %} {% if field.help_text %}
{{ field.help_text }}
{% endif %} {% elif field.type == 'image' %}
Upload photo
{% if field.help_text %}
{{ field.help_text }}
{% endif %} {% elif field.type == 'signature' %}
Sign here…
{% if field.help_text %}
{{ field.help_text }}
{% endif %} {% elif field.type == 'rating' %}
{% for i in range(1, 6) %} {% endfor %}
{% if field.help_text %}
{{ field.help_text }}
{% endif %} {% elif field.type == 'label' %} {% set fs_map = {'small':'0.78rem','normal':'0.9rem','large':'1.05rem','x-large':'1.25rem'} %}
{{ field.text_content or 'Label text' }}
{% elif field.type == 'button_submit' %} {% elif field.type == 'button_print' %} {% elif field.type == 'button_email' %} {% elif field.type == 'table' %}
{% for hdr in (field.col_headers or ['Column 1','Column 2','Column 3']) %} {% endfor %} {% for r in range(field.table_rows or 3) %} {% for hdr in (field.col_headers or ['Column 1','Column 2','Column 3']) %} {% endfor %} {% endfor %}
{{ hdr }}
{% if field.help_text %}
{{ field.help_text }}
{% endif %} {% endif %}
{% endfor %}
{% else %}
No fields yet

This template has no form fields. Open the editor to add some.

{% endif %}
{% endblock %} {% block extra_js %} {% endblock %}