{% extends "base.html" %} {% block title %}{{ title }}{% endblock %} {% block content %} {% include '_quota_warning.html' %}
{{ 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 #} {% for field in [form.severity, form.description, form.photo] %}
{{ field.label(class="form-label fw-semibold") }} {{ field(class="form-select" if field.type == 'SelectField' else "form-control", rows=4 if field.type == 'TextAreaField' else none) }} {% for e in field.errors %}
{{ e }}
{% endfor %}
{% endfor %} {% if current_user.role != 'customer' %}
{{ form.assigned_to.label(class="form-label fw-semibold") }} {{ form.assigned_to(class="form-select") }} {% for e in form.assigned_to.errors %}
{{ e }}
{% endfor %}
{% endif %} {# ── Handled By (phase44) — staff only; customers stay internal ── #} {% if current_user.role != 'customer' %}

Handled By

{{ form.handler_type(class="form-select", id="handlerTypeSelect") }}
{{ form.internal_handler_name.label(class="form-label small fw-semibold mb-1") }} {{ form.internal_handler_name(class="form-control form-control-sm", placeholder="Crew member handling this") }}
{{ form.internal_handler_contact.label(class="form-label small fw-semibold mb-1") }} {{ form.internal_handler_contact(class="form-control form-control-sm", placeholder="Phone or email") }}
{% endif %}
Cancel
{% endblock %} {% block extra_js %} {% endblock %}