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