Jul 30 - Internal handler files

This commit is contained in:
2026-07-30 12:14:04 -04:00
parent d9bf4be709
commit ceb0b806af
7 changed files with 323 additions and 20 deletions
+87
View File
@@ -46,6 +46,93 @@
</div>
{% endif %}
{# ── Handled By (phase44) — staff only; customers stay internal ── #}
{% if current_user.role != 'customer' %}
<hr class="my-3">
<p class="fw-semibold mb-2">
<i class="bi bi-person-check me-1 text-secondary"></i>Handled By
</p>
<div class="mb-3">
{{ form.handler_type(class="form-select", id="handlerTypeSelect") }}
<div class="form-text" id="handlerTypeHelp"></div>
</div>
<div id="internalHandlerFields">
<div class="mb-2">
{{ 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") }}
</div>
<div class="mb-3">
{{ 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") }}
</div>
</div>
<div id="facilityHandlerFields" style="display:none;">
<div class="mb-2">
{{ form.facility_handler_name.label(class="form-label small fw-semibold mb-1") }}
{{ form.facility_handler_name(class="form-control form-control-sm",
placeholder="Contact name at the facility") }}
</div>
<div class="mb-2">
{{ form.facility_handler_contact.label(class="form-label small fw-semibold mb-1") }}
{{ form.facility_handler_contact(class="form-control form-control-sm",
placeholder="Phone or email") }}
</div>
<div class="mb-3">
{{ form.facility_handler_notes.label(class="form-label small fw-semibold mb-1") }}
{{ form.facility_handler_notes(class="form-control form-control-sm", rows=2,
placeholder="Notes about what they are handling…") }}
</div>
</div>
<div id="vendorHandlerFields" style="display:none;">
<div class="mb-2">
{{ form.vendor_name.label(class="form-label small fw-semibold mb-1") }}
{{ form.vendor_name(class="form-control form-control-sm",
placeholder="Contractor or vendor name") }}
</div>
<div class="mb-2">
{{ form.vendor_contact.label(class="form-label small fw-semibold mb-1") }}
{{ form.vendor_contact(class="form-control form-control-sm",
placeholder="Phone or email") }}
</div>
<div class="mb-3">
{{ form.vendor_notes.label(class="form-label small fw-semibold mb-1") }}
{{ form.vendor_notes(class="form-control form-control-sm", rows=2,
placeholder="Scope, quote reference, etc.") }}
</div>
</div>
<script>
(function(){
var sel = document.getElementById('handlerTypeSelect');
var help = document.getElementById('handlerTypeHelp');
var boxes = {
internal: document.getElementById('internalHandlerFields'),
facility: document.getElementById('facilityHandlerFields'),
vendor: document.getElementById('vendorHandlerFields')
};
var notes = {
internal: {{ (issue_handler_descriptions or {}).get('internal', '')|tojson }},
facility: {{ (issue_handler_descriptions or {}).get('facility', '')|tojson }},
vendor: {{ (issue_handler_descriptions or {}).get('vendor', '')|tojson }}
};
function sync(){
var v = sel ? sel.value : 'internal';
for (var k in boxes){
if (boxes[k]) { boxes[k].style.display = (k === v) ? '' : 'none'; }
}
if (help) { help.textContent = notes[v] || ''; }
}
if (sel){ sel.addEventListener('change', sync); }
sync();
})();
</script>
{% endif %}
<div class="d-flex gap-2">
<button type="submit" class="btn btn-danger">Log Issue</button>
<a href="{{ url_for('issues.index') }}" class="btn btn-outline-secondary">Cancel</a>