From 47a49a743807304fa5860a91c3e185fac4d9a087 Mon Sep 17 00:00:00 2001 From: NguyenND Date: Fri, 6 Feb 2026 17:25:53 -0500 Subject: [PATCH] Phase 2: enhancements --- app/templates/templates/view.html | 128 ++++++++++++++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 app/templates/templates/view.html diff --git a/app/templates/templates/view.html b/app/templates/templates/view.html new file mode 100644 index 0000000..a504314 --- /dev/null +++ b/app/templates/templates/view.html @@ -0,0 +1,128 @@ +{% extends "base.html" %} + +{% block title %}{{ template.name }}{% endblock %} + +{% block content %} +
+
+

{{ template.name }}

+

{{ template.description or 'No description provided' }}

+
+
+ {% if current_user.role in ['admin', 'supervisor'] %} + + Edit Template + +
+ +
+ {% endif %} +
+
+ +
+
+
+
+
Template Details
+
+
+ + + + + + + + + + + + + + + + + +
Frequency: + {{ template.frequency|title }} +
Total Items:{{ template.checklist_items.count() }}
Created:{{ template.created_at.strftime('%Y-%m-%d %H:%M') if template.created_at else 'N/A' }}
Total Inspections:{{ template.inspections.count() }}
+
+
+
+ +
+
+
+
Statistics
+
+
+
+
+

{{ items_by_category|length }}

+ Categories +
+
+

{{ template.checklist_items.count() }}

+ Checklist Items +
+
+
+
+
+
+ +
+
+
Checklist Preview
+
+
+ {% if items_by_category %} + {% for category, items in items_by_category.items() %} +
+
+ {{ category }} + {{ items|length }} items +
+ +
+ {% for item in items %} +
+
+
+
+ {{ item.scoring_type.replace('_', ' ')|title }} + {% if item.requires_photo %} + + Photo Required + + {% endif %} + Weight: {{ item.weight }} +
+

{{ item.item_description }}

+
+
+
+ {% endfor %} +
+
+ {% endfor %} + {% else %} +
+ No checklist items defined for this template yet. + {% if current_user.role in ['admin', 'supervisor'] %} + Click here to add items. + {% endif %} +
+ {% endif %} +
+
+ +
+ + Back to Templates + +
+{% endblock %} \ No newline at end of file