Lists every published version newest-first, marks the one on screen, and links
to the others via ?ver=. Retired and pre-release versions are labelled
rather than hidden: a reader following a citation to v4 needs to find it, and
needs to be told it is superseded. A restricted version (under review;
see atlas_allow_access()) is shown too – locked, and linked through
href_restricted when the caller supplies one, so a reviewer on the public
app finds the door to the signed-in preview host rather than a dead link.
Usage
version_picker_html(
current,
versions = NULL,
href = function(v) sprintf("?ver=%s", v),
href_restricted = NULL
)Arguments
- current
the version being displayed
- versions
data frame from
atlas_versions(); fetched ifNULL- href
a function of the version label returning its link (default
?ver={v})- href_restricted
link builder for restricted versions, or
NULLto usehref(the preview instance, where restricted versions render in place). The public app passes e.g.function(v) sprintf("%s/scores/?ver=%s", atlas_preview_url(), v).