Template:Category/Review record/State

From Miniscope
Revision as of 13:07, 2 May 2026 by DAharoni (talk | contribs) (SchemaSync: sync from repo @ cef7b4698b6a7bf05768b7fe97b5c01c55c4b039)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Annotation emitter + Review status sidebox for Template:Category/Review record. Called once via #ask|format=template|import-annotation=true with the latest Review record's date, optional per-record next-due override, and the latest record's reviewer(s).

The import-annotation=true parameter on the parent #ask is essential — without it the #set calls below would not attach to the host page.

Does three jobs in one pass:

  1. Emits page-level annotations:
    • Has last reviewed date = ReviewDate
    • Has next review due = Override if provided, else
  ReviewDate + the page's Has review interval (months).
  1. Renders the "Review status" sidebox top half (status table).
  2. Renders a collapsible "Review history" block at the bottom of the
 sidebox via a nested #ask on all Review record subobjects
 of the host page, delegating per-row formatting to
 Template:Category/Review record/History row.

Date arithmetic uses Unix-timestamp @ form because Error: Invalid time. is not honored on this wiki. A month is approximated as 30.4375 × 86400 = 2,629,800 seconds.

Uses rather than Y for annotations — silent equivalent.

Parameters (named args from the parent #ask):

  • ReviewDate — ISO date of the latest review
  • Override — optional ISO date overriding the computed next
 review due
  • Reviewer — page link(s) to the reviewer(s) on the latest
 record (SMW joins multivalued with commas)