Skip to main content

Module helpers

Module helpers 

Source
Expand description

General purpose auxiliary routines that do not fit the MVC web service paradigm, tending to minor tasks

Functions§

decorate_uri_encodings
Auto-generates a URI-encoded “foo_uri” entry for each “foo” label associated with a clickable link (for Tera templates)
group_thousands
Groups an integer into thousands with commas (28204842,820,484) for human-facing counts (corpus document totals, fleet throughput) that can reach millions. Agents get the raw number; only the rendered HTML is grouped.
iso_utc
Formats a UTC chrono::NaiveDateTime (how CorTeX stores every timestamp) as an RFC 3339 / ISO 8601 string with an explicit +00:00 offset, e.g. 2026-06-15T05:52:00+00:00. This is the machine-readable, zone-unambiguous form emitted in DTO time fields and <time datetime="…"> attributes: the browser ([public/js/localtime.js]) rewrites it to the viewer’s local time with the zone code (EST/EDT/…), and agents get a directly parseable timestamp. Replaces the old zone-ambiguous %Y-%m-%d %H:%M rendering, which silently displayed UTC as if it were local.
report_timestamp
The “generated at” timestamp shown in report footers: the server’s local date and time to the minute, suffixed with the time-zone abbreviation — e.g. Sat, 13 Jun 2026 22:57 EDT.
severity_highlight
Maps a cortex message severity into a bootstrap class for color highlight
uri_escape
TODO: Is this outdated? Maps a regular string into a URI-encoded one
uri_unescape
TODO: Is this outdated? Maps a URI-encoded string into its regular plain text form