Template:Category/Maintenance record/State

From Miniscope
Jump to: navigation, search

Annotation emitter + Maintenance status sidebox for Template:Category/Maintenance record. Called once via #ask|format=template|import-annotation=true with the latest Maintenance record's date, performer(s), and type.

Mirrors Template:Category/Review record/State structurally — see that template for the rationale on import-annotation, single-line annotation block (whitespace-leak avoidance), and date arithmetic.

Does three jobs in one pass:

  1. Emits page-level annotations:
    • Has last maintained = MaintenanceDate
    • Has next maintenance date = MaintenanceDate + the page's
  Has maintenance interval (months).
  1. Renders the "Maintenance status" sidebox top half (status table).
  2. Renders a collapsible "Maintenance history" block at the bottom of
 the sidebox via a nested #ask on all Maintenance record
 subobjects, delegating per-row formatting to
 Template:Category/Maintenance record/History row.

Parameters (named args from the parent #ask):

  • MaintenanceDate — ISO date of the latest maintenance event
  • PerformedBy — page link(s) to the person/people who
 performed the latest maintenance event
  • Type — maintenance type (Calibration / Repair / Routine
 Service / Inspection)