Jul 9 - Update the 'Handled by' more clear and understandable

This commit is contained in:
2026-07-09 10:49:55 -04:00
parent b2ac816bc2
commit f8807dc371
9 changed files with 40 additions and 15 deletions
+8 -2
View File
@@ -115,15 +115,21 @@ class Issue(db.Model):
return self.followers.filter_by(user_id=user.id).first() is not None
# Human-readable label for the handler category (phase35).
# Perspective-neutral wording so it reads the same for staff and customers.
HANDLER_LABELS = {
'internal': 'Our Staff',
'internal': 'Janitorial Staff',
'facility': 'Facility Staff',
'vendor': 'External Vendor',
}
HANDLER_DESCRIPTIONS = {
'internal': 'Our janitorial crew handles it.',
'facility': "The facility's own on-site staff handle it.",
'vendor': 'An outside contractor handles it.',
}
@property
def handler_label(self):
return self.HANDLER_LABELS.get(self.handler_type or 'internal', 'Our Staff')
return self.HANDLER_LABELS.get(self.handler_type or 'internal', 'Janitorial Staff')
@property
def resolved_facility(self):
+8
View File
@@ -41,6 +41,7 @@
<div class="mb-3">
{{ form.handler_type.label(class="form-label fw-semibold") }}
{{ form.handler_type(class="form-select", id="handler_type_select") }}
<div class="form-text" id="handler_desc"></div>
</div>
<div class="mb-3">
<label class="form-label fw-semibold" id="assigned_to_label">Assign To</label>
@@ -157,6 +158,11 @@
// ── "Handled By" — reveal the facility/vendor sub-block + relabel assignee ──
var handlerSelect = document.getElementById('handler_type_select');
var HANDLER_DESC = {
'internal': 'Our janitorial crew handles it.',
'facility': "The facility's own on-site staff handle it.",
'vendor': 'An outside contractor handles it.'
};
function syncHandlerUI() {
if (!handlerSelect) { return; }
var v = handlerSelect.value;
@@ -164,6 +170,8 @@
var venBlock = document.getElementById('vendor_block');
if (facBlock) { facBlock.style.display = (v === 'facility') ? '' : 'none'; }
if (venBlock) { venBlock.style.display = (v === 'vendor') ? '' : 'none'; }
var desc = document.getElementById('handler_desc');
if (desc) { desc.textContent = HANDLER_DESC[v] || ''; }
var label = document.getElementById('assigned_to_label');
var help = document.getElementById('assigned_to_help');
if (label) {
+1 -1
View File
@@ -86,7 +86,7 @@
<label class="form-label small mb-1">Handled By</label>
<select name="handler_type" class="form-select form-select-sm">
<option value="">All Handlers</option>
<option value="internal" {{ 'selected' if handler_filter == 'internal' }}>Our Staff</option>
<option value="internal" {{ 'selected' if handler_filter == 'internal' }}>Janitorial Staff</option>
<option value="facility" {{ 'selected' if handler_filter == 'facility' }}>Facility Staff</option>
<option value="vendor" {{ 'selected' if handler_filter == 'vendor' }}>External Vendor</option>
</select>
+12 -3
View File
@@ -76,11 +76,11 @@
<dt class="col-sm-3">Handled By</dt>
<dd class="col-sm-9">
{% if issue.handler_type == 'facility' %}
<span class="badge bg-info text-dark"><i class="bi bi-building me-1"></i>Facility Staff</span>
<span class="badge bg-info text-dark" title="The facility's own on-site staff handle it."><i class="bi bi-building me-1"></i>Facility Staff</span>
{% elif issue.handler_type == 'vendor' %}
<span class="badge bg-warning text-dark"><i class="bi bi-person-gear me-1"></i>External Vendor</span>
<span class="badge bg-warning text-dark" title="An outside contractor handles it."><i class="bi bi-person-gear me-1"></i>External Vendor</span>
{% else %}
<span class="badge bg-primary"><i class="bi bi-people me-1"></i>Our Staff</span>
<span class="badge bg-primary" title="Our janitorial crew handles it."><i class="bi bi-people me-1"></i>Janitorial Staff</span>
{% endif %}
</dd>
@@ -373,6 +373,7 @@
<div class="mb-3">
{{ form.handler_type.label(class="form-label fw-semibold") }}
{{ form.handler_type(class="form-select", id="handler_type_select") }}
<div class="form-text" id="handler_desc"></div>
</div>
{% endif %}
@@ -549,6 +550,11 @@
// ── "Handled By" — show the relevant sub-block (facility vs vendor) and
// relabel the assignee as a follow-up owner for facility/vendor. ──
var handlerSelect = document.getElementById('handler_type_select');
var HANDLER_DESC = {
'internal': 'Our janitorial crew handles it.',
'facility': "The facility's own on-site staff handle it.",
'vendor': 'An outside contractor handles it.'
};
function syncHandlerUI() {
if (!handlerSelect) { return; }
var v = handlerSelect.value;
@@ -557,6 +563,9 @@
if (facBlock) { facBlock.style.display = (v === 'facility') ? '' : 'none'; }
if (venBlock) { venBlock.style.display = (v === 'vendor') ? '' : 'none'; }
var desc = document.getElementById('handler_desc');
if (desc) { desc.textContent = HANDLER_DESC[v] || ''; }
var label = document.getElementById('assigned_to_label');
var help = document.getElementById('assigned_to_help');
if (label) {
+2 -2
View File
@@ -173,7 +173,7 @@ class IssueForm(FlaskForm):
assigned_to = SelectField('Assign To', coerce=int, validators=[Optional()])
# Who handles the issue (phase35) — set at creation by staff
handler_type = SelectField('Handled By', choices=[
('internal', 'Our Staff'),
('internal', 'Janitorial Staff'),
('facility', 'Facility Staff'),
('vendor', 'External Vendor'),
], validators=[Optional()])
@@ -199,7 +199,7 @@ class IssueUpdateForm(FlaskForm):
])
# Who handles the issue (phase35)
handler_type = SelectField('Handled By', choices=[
('internal', 'Our Staff'),
('internal', 'Janitorial Staff'),
('facility', 'Facility Staff'),
('vendor', 'External Vendor'),
], validators=[Optional()])