{% extends "base.html" %} {% block title %}{{ title }}{% endblock %} {% block content %}
{{ title }}
{# Contract selector — UI only; narrows the facility list via AJAX #}
{# Facility — populated by JS once a contract is chosen #}
{{ form.facility_id.label(class="form-label fw-semibold") }} {{ form.facility_id(class="form-select", id="facility_id") }} {% for e in form.facility_id.errors %}
{{ e }}
{% endfor %}
{# Remaining fields — assigned_to hidden from customer role #}
{{ form.severity.label(class="form-label fw-semibold") }} {{ form.severity(class="form-select") }} {% for e in form.severity.errors %}
{{ e }}
{% endfor %}
{{ form.description.label(class="form-label fw-semibold") }} * {{ form.description(class="form-control", rows=4, required=True, placeholder="Describe the issue in detail…") }} {% for e in form.description.errors %}
{{ e }}
{% endfor %}
{{ form.photo.label(class="form-label fw-semibold") }} {{ form.photo(class="form-control") }} {% for e in form.photo.errors %}
{{ e }}
{% endfor %}
{% if current_user.role != 'customer' %}
{{ form.handler_type.label(class="form-label fw-semibold") }} {{ form.handler_type(class="form-select", id="handler_type_select") }}
{{ form.assigned_to(class="form-select") }} {% for e in form.assigned_to.errors %}
{{ e }}
{% endfor %}
{# Janitorial-staff handler — shown when Handled By = Janitorial Staff #} {# Facility-staff handler — shown when Handled By = Facility Staff #} {# External vendor — shown when Handled By = External Vendor #} {% endif %}
Cancel
{% endblock %} {% block extra_js %} {% endblock %}