diff --git a/app/templates/inspections/execute.html b/app/templates/inspections/execute.html index 8bf7e19..1e99f38 100644 --- a/app/templates/inspections/execute.html +++ b/app/templates/inspections/execute.html @@ -30,12 +30,12 @@ .form-grid { display: grid; grid-template-columns: repeat(12, 72px); - grid-auto-rows: auto; + grid-auto-rows: 52px; /* matches editor CELL_H — keeps proportions tight */ gap: 4px 8px; width: max-content; } .fg-cell { - overflow:hidden; display:flex; flex-direction:column; padding:.22rem .55rem; + overflow:hidden; display:flex; flex-direction:column; padding:.18rem .45rem; } .fg-cell .field-lbl { font-size:.74rem; font-weight:500; color:#64748b; @@ -53,13 +53,13 @@ } .fg-cell .form-control:focus, .fg-cell .form-select:focus { border-color:#2563eb; background:#fff; box-shadow:none; } - .fg-cell textarea.form-control { resize:vertical; flex:1; min-height:60px; } + .fg-cell textarea.form-control { resize:none; flex:1; min-height:0; } .fg-cell .form-check-label { font-size:.76rem; color:#64748b; } .fg-cell .form-check-input { margin-top:.18rem; } .fg-cell .form-check { margin-bottom:.1rem; } .upload-zone { - border:2px dashed #cbd5e1; border-radius:6px; flex:1; min-height:60px; + border:2px dashed #cbd5e1; border-radius:6px; flex:1; min-height:0; display:flex; flex-direction:column; align-items:center; justify-content:center; color:#64748b; background:#f8fafc; cursor:pointer; font-size:.74rem; gap:.2rem; transition:border-color .18s, background .18s; position:relative; @@ -72,7 +72,7 @@ .upload-zone .file-name { font-size:.7rem; color:#2563eb; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; } .signature-pad-wrap { - flex:1; min-height:80px; border-radius:6px; border:1px solid #e2e8f0; + flex:1; min-height:0; border-radius:6px; border:1px solid #e2e8f0; background:#f8fafc; position:relative; overflow:hidden; } .signature-pad-wrap canvas { width:100%; height:100%; cursor:crosshair; display:block; } @@ -84,10 +84,10 @@ } .sig-clear:hover { color:#dc2626; border-color:#dc2626; } - .rating-stars { display:flex; gap:.25rem; align-items:center; padding-top:.08rem; } + .rating-stars { display:flex; flex-direction:row; flex-wrap:nowrap; gap:.2rem; align-items:center; padding-top:.05rem; } .rating-stars button { - border:none; background:none; font-size:1.45rem; color:#cbd5e1; - cursor:pointer; padding:0; line-height:1; transition:color .12s; + border:none; background:none; font-size:1.2rem; color:#cbd5e1; + cursor:pointer; padding:0; line-height:1; transition:color .1s; flex-shrink:0; } .rating-stars button:hover, .rating-stars button.on { color:#f59e0b; } diff --git a/app/templates/inspections/view.html b/app/templates/inspections/view.html index f509c02..fbfebd6 100644 --- a/app/templates/inspections/view.html +++ b/app/templates/inspections/view.html @@ -4,139 +4,94 @@ {% block extra_css %} {% endblock %} {% block content %} -
+
{# Action bar #} -
+
- Back + Back to Inspections
+ {% else %} + No photo + {% endif %} +
+ + {% elif field.type == 'signature' %} + {{ field.label }} +
+ {% if val and val.startswith('data:') %} + + {% else %} + No signature + {% endif %} +
+ + {% elif field.type == 'checkbox' %} + {{ field.label }} +
+ {% if val == 'yes' %} + Yes + {% else %} + No + {% endif %} +
+ + {% elif field.type == 'checkbox_group' %} + {{ field.label }} +
+ {% if val and val is iterable and val is not string %} + {% for item in val %}{{ item }}{% endfor %} + {% else %} + None selected + {% endif %} +
+ + {% elif field.type == 'table' %} + {{ field.label }} + {% if val and val is iterable and val is not string %} +
+ + {% for hdr in (field.col_headers or ['Column 1']) %}{% endfor %} + + {% for row in val %} + {% for hdr in (field.col_headers or ['Column 1']) %}{% endfor %} + {% endfor %} + +
{{ hdr }}
{{ row.get(hdr,'') }}
+
+ {% else %} +
No data
{% endif %} -
- {{ field.label }} - - {# ── Rating ── #} - {% if ftype == 'rating' %} - {% set score = val | int %} - {% if score > 0 %} - - {% for i in range(1,6) %}{{ '★' if i <= score else '☆' }}{% endfor %} - {{ score }}/5 - - {% else %} - Not rated - {% endif %} - - {# ── Image / Photo ── #} - {% elif ftype == 'image' %} - {% if val %} - - - {% else %} - No photo - {% endif %} - - {# ── Signature ── #} - {% elif ftype == 'signature' %} - {% if val and val.startswith('data:') %} - - - {% else %} - No signature - {% endif %} - - {# ── Checkbox single ── #} - {% elif ftype == 'checkbox' %} - {% if val == 'yes' %} - Yes - {% else %} - No - {% endif %} - - {# ── Checkbox group ── #} - {% elif ftype == 'checkbox_group' %} - - {% if val and val is iterable and val is not string and val | length > 0 %} - {% for opt in val %}{{ opt }}{% endfor %} - {% else %} - None selected - {% endif %} - - - {# ── Table ── #} - {% elif ftype == 'table' %} - - {% if val and val is iterable and val is not string %} - - - {% for hdr in (field.col_headers or ['Column 1']) %}{% endfor %} - - - {% for row in val %} - {% for hdr in (field.col_headers or ['Column 1']) %}{% endfor %} - {% endfor %} - -
{{ hdr }}
{{ row.get(hdr,'') }}
- {% else %} - No data - {% endif %} -
- - {# ── Everything else: text, textarea, number, date, email, radio, select ── #} - {% else %} - {% if val %} - {{ val }} - {% else %} - - {% endif %} - {% endif %} - -
{# /field-row #} + {% else %} + {# text, textarea, number, date, email, radio, select #} + {{ field.label }} +
{{ val or '—' }}
{% endif %} + +
{% endfor %} +
{% else %} -

No form fields found for this template.

+

No form fields found for this template.

{% endif %} {# Issues #} {% if issues %} -
-
Issues ({{ issues|length }})
-
- - - - - - - - - - - - {% for issue in issues %} - - - - - - - - {% endfor %} - -
SeverityAreaDescriptionStatus
{{ issue.severity|title }}{{ issue.area.name }}{{ issue.description[:80] }}{% if issue.description|length > 80 %}…{% endif %}{{ issue.status|replace('_',' ')|title }}View
-
+
+
Issues Logged ({{ issues|length }})
+
+ + + + + + {% for issue in issues %} + + + + + + + + {% endfor %} + +
SeverityAreaDescriptionStatus
{{ issue.severity|title }}{{ issue.area.name }}{{ issue.description[:80] }}{% if issue.description|length > 80 %}…{% endif %}{{ issue.status|replace('_',' ')|title }}View
{% endif %} -
{# /insp-body #} -
{# /insp-wrap #} +
+ {# Photo / Signature lightbox #} -
-
-
- Photo - +
+
+
+ Photo +
- Photo +
{% endblock %} {% block extra_js %} {% endblock %}