Jul 8 - Update issue assignment separation
This commit is contained in:
@@ -39,10 +39,55 @@
|
||||
{% endfor %}
|
||||
{% if current_user.role != 'customer' %}
|
||||
<div class="mb-3">
|
||||
{{ form.assigned_to.label(class="form-label fw-semibold") }}
|
||||
{{ form.handler_type.label(class="form-label fw-semibold") }}
|
||||
{{ form.handler_type(class="form-select", id="handler_type_select") }}
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label fw-semibold" id="assigned_to_label">Assign To</label>
|
||||
{{ form.assigned_to(class="form-select") }}
|
||||
<div class="form-text" id="assigned_to_help" style="display:none;">
|
||||
The facility/vendor does the work; this is our follow-up owner.
|
||||
</div>
|
||||
{% for e in form.assigned_to.errors %}<div class="text-danger small">{{ e }}</div>{% endfor %}
|
||||
</div>
|
||||
|
||||
{# Facility-staff handler — shown when Handled By = Facility Staff #}
|
||||
<div id="facility_handler_block" 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="Facility staff / point of contact") }}
|
||||
</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="What the facility staff are handling…") }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{# External vendor — shown when Handled By = External Vendor #}
|
||||
<div id="vendor_block" 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="Notes about what the contractor is handling…") }}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="d-flex gap-2">
|
||||
@@ -109,6 +154,29 @@
|
||||
} else {
|
||||
setPlaceholder();
|
||||
}
|
||||
|
||||
// ── "Handled By" — reveal the facility/vendor sub-block + relabel assignee ──
|
||||
var handlerSelect = document.getElementById('handler_type_select');
|
||||
function syncHandlerUI() {
|
||||
if (!handlerSelect) { return; }
|
||||
var v = handlerSelect.value;
|
||||
var facBlock = document.getElementById('facility_handler_block');
|
||||
var venBlock = document.getElementById('vendor_block');
|
||||
if (facBlock) { facBlock.style.display = (v === 'facility') ? '' : 'none'; }
|
||||
if (venBlock) { venBlock.style.display = (v === 'vendor') ? '' : 'none'; }
|
||||
var label = document.getElementById('assigned_to_label');
|
||||
var help = document.getElementById('assigned_to_help');
|
||||
if (label) {
|
||||
label.textContent = (v === 'facility' || v === 'vendor') ? 'Follow-up Owner' : 'Assign To';
|
||||
}
|
||||
if (help) {
|
||||
help.style.display = (v === 'facility' || v === 'vendor') ? '' : 'none';
|
||||
}
|
||||
}
|
||||
if (handlerSelect) {
|
||||
handlerSelect.addEventListener('change', syncHandlerUI);
|
||||
syncHandlerUI();
|
||||
}
|
||||
}());
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user