Jul 27 - Update code for scheduled tasks
This commit is contained in:
@@ -263,6 +263,21 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{# ── Instructions from the schedule (phase36) ──
|
||||
Only rendered when this inspection was started from a ScheduledInspection
|
||||
that carries instructions. `scheduled_inspection` is NULL for ad-hoc work
|
||||
and for schedules deleted after the inspection was started, so both the
|
||||
relationship and the text are guarded. #}
|
||||
{% if inspection.scheduled_inspection and inspection.scheduled_inspection.notes %}
|
||||
<div style="background:#eef2ff;border:1px solid #c7d2fe;border-left:4px solid #6366f1;
|
||||
padding:.9rem 1.1rem;margin-top:.85rem;border-radius:8px;">
|
||||
<div class="fw-semibold mb-1" style="color:#3730a3;font-size:.9rem;">
|
||||
<i class="bi bi-info-circle-fill"></i> Instructions for this inspection
|
||||
</div>
|
||||
<div style="white-space:pre-wrap;color:#1e1b4b;font-size:.9rem;">{{ inspection.scheduled_inspection.notes }}</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{# ── Form body ── #}
|
||||
<div class="insp-body">
|
||||
{% if form_fields %}
|
||||
|
||||
@@ -112,7 +112,11 @@
|
||||
|
||||
<div class="mb-3">
|
||||
{{ form.notes.label(class="form-label fw-semibold") }}
|
||||
{{ form.notes(class="form-control", rows=2, placeholder="Optional instructions for the inspector…") }}
|
||||
{{ form.notes(class="form-control", rows=3, placeholder="e.g. Front lobby carpet needs extra attention. Check loading dock after 3 PM — key is at the front desk.") }}
|
||||
<div class="form-text">
|
||||
<i class="bi bi-info-circle"></i>
|
||||
Shown to the assigned inspector when they open this inspection, on the web and on the iPad.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-check mb-3">
|
||||
|
||||
+4
-1
@@ -339,7 +339,10 @@ class ScheduledInspectionForm(FlaskForm):
|
||||
('weekly', 'Weekly'), ('monthly', 'Monthly'),
|
||||
], validators=[DataRequired()])
|
||||
next_due_date = DateField('Start / Due Date', validators=[DataRequired()])
|
||||
notes = TextAreaField('Notes', validators=[Optional(), Length(max=1000)])
|
||||
# UI label only. The field name, the ScheduledInspection.notes attribute and
|
||||
# the scheduled_inspections.notes column all stay `notes` — renaming any of
|
||||
# them would break the API payload key the iPad decodes.
|
||||
notes = TextAreaField('Instructions', validators=[Optional(), Length(max=1000)])
|
||||
active = BooleanField('Active', default=True)
|
||||
|
||||
# ── Recurrence detail (phase43) ──────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user