{{define "visibilityBadge" -}} {{if eq (printf "%s" .) "PUBLIC" -}} public {{- else if eq (printf "%s" .) "UNLISTED" -}} unlisted {{- else -}} private {{- end}} {{- end}} {{/* viewtabs renders the repo's tab bar: a fixed "Overview" tab, a "Tables" tab for the always-available generic browser, then one tab per applicable View. Invoke it with a dict context: {{template "viewtabs" (dict "Repo" .Repo "Views" .Views "Current" "overview" "Ref" .DefaultBranch)}} .Current selects the active tab: "overview", "tables", or a view's slug. .Ref is the branch/ref the Tables tab links to (falls back to the overview when empty). */}} {{define "viewtabs" -}} {{$repo := .Repo}}{{$current := .Current}}{{$ref := .Ref}} {{- end}} {{/* beadsHead renders the freshness line the beads-family views carry under their title: " · last commit · ", the hash linking to the commit page and the exact stamp one hover away in the title attribute. Invoke it with a dict context, as viewtabs above: {{template "beadsHead" (dict "Repo" .Repo "Ref" .Ref "Head" .Head)}} .Head is the envelope's *browse.CommitInfo (handleView fills it for every view). It is nil for a database with no commits, or when reading the log failed, and then this renders nothing at all: the line says how fresh the page is, and a line that cannot answer that must not draw a shape that looks like an answer. The class is styled by each page's own scoped stylesheet. */}} {{define "beadsHead" -}} {{with .Head}}

{{$.Ref}} · last commit {{.Date | ago}} · {{.Hash | shortsha}}

{{end}} {{- end}} {{/* The database listing used to live here as "repoList". It is now sr-ht-ecore's "srht-repo-list", whose markup this copy already matched line for line; handlers build its chrome.RepoList dot (repoList in handlers_repo.go). */}}