first commit

This commit is contained in:
libroot 2026-11-19 04:40:59 +02:00
commit 8c4dcae475
Signed by: libroot
GPG key ID: 2AC68C029EBE9ACE
89 changed files with 24623 additions and 0 deletions

95
templates/list.html Normal file
View file

@ -0,0 +1,95 @@
{{ define "title" }}{{ with .CatLabel }}{{ . }}{{ else }}Category{{ end }}: {{ .Title }} - Snowden Archive{{ end }}
{{ define "content" }}
<header class="list-header">
<h1>{{ with .CatLabel }}{{ . }}{{ else }}Category{{ end }}: {{ .Title }}
{{- if eq .ActiveCategory "agency" }}{{ with agencyName .Title }} <small class="muted cat-note">{{ . }}</small>{{ end }}{{ end }}
<small class="count-note">{{ .Total }} document{{ if ne .Total 1 }}s{{ end }}</small>
</h1>
{{ if .SearchLink }}
<a href="{{ .SearchLink }}" class="faint search-link">Search documents matching &ldquo;{{ .Title }}&rdquo; &rarr;</a>
{{ end }}
{{ with .Blurb }}<p class="muted cat-blurb">{{ . }}</p>{{ end }}
{{ with .YearScope }}
<p class="muted coll-scope">Showing the documents {{ $.Title }} itself published in <strong>{{ . }}</strong> -
<a href="{{ $.YearScopeAllURL }}">all years</a>.</p>
{{ end }}
</header>
{{ if .MonthNav }}
<nav class="month-nav" aria-label="Months in {{ .MonthNavYear }}">
<a href="{{ .MonthNavYearURL }}"{{ if .MonthNavYearActive }} class="active"{{ end }}>All {{ .MonthNavYear }}</a>
{{ range .MonthNav }}<a href="{{ .URL }}"{{ if .Active }} class="active"{{ end }}>{{ .Label }} <span class="facet-count">{{ .Count }}</span></a>
{{ end }}
{{ if .MonthlessCount }}<span class="faint month-nav-note">+{{ .MonthlessCount }} in {{ .MonthNavYear }} with year-only dates</span>{{ end }}
</nav>
{{ end }}
{{ with .GlossaryEntry }}
<div class="glossary-box">
<strong>{{ .Term }}</strong>
{{ if .Aka }}<span class="muted glossary-aka">(a.k.a. {{ range $i, $a := .Aka }}{{ if $i }}, {{ end }}{{ $a }}{{ end }})</span>{{ end }}
- {{ .DefinitionHTML }}
<a href="/glossary#term-{{ pathEscape .Term }}" class="glossary-search">glossary &rarr;</a>
</div>
{{ end }}
{{ if or .Timeline .PubTimeline .Breakdowns }}
<details class="entity-timeline">
<summary>Graphs</summary>
{{ if .Timeline }}{{ template "timeline-hist" (dict "Bars" .Timeline "Label" "By document date" "Verb" "dated") }}{{ end }}
{{ if .PubTimeline }}{{ template "timeline-hist" (dict "Bars" .PubTimeline "Label" "By published date" "Verb" "published") }}{{ end }}
{{ range .Breakdowns }}
<div class="timeline-block">
<h2 class="timeline-label">By {{ .Label }}</h2>
<div class="breakdown-bars">
{{ range .Values }}
<a class="bd-row" href="{{ .URL }}" title="{{ .Count }} documents - open as a search">
<span class="bd-name">{{ .Value }}</span>
<span class="bd-track"><span class="bd-bar" style="width: {{ .Pct }}%"></span></span>
<span class="bd-count">{{ .Count }}</span>
</a>
{{ end }}
</div>
</div>
{{ end }}
</details>
{{ end }}
{{ if .Refinements }}
<details class="search-facets">
<summary>Refine <span class="faint">(combine with another filter, via search)</span></summary>
<div class="facets-body">
{{ range .Refinements }}
<div class="facet-group">
<span class="facet-label">{{ .Label }}</span>
<span class="facet-values">{{ range .Values }}<a class="facet-link" href="{{ .URL }}">{{ .Name }}<span class="facet-count">{{ .Count }}</span></a>{{ end }}</span>
</div>
{{ end }}
</div>
</details>
{{ end }}
<div class="list-controls">
{{ if ne .View "table" }}
{{ template "sort-bar" (dict "SortURL" .SortURL "SortBy" .Sort "Order" .Order "ShowRelevance" false "DefaultSort" .DefaultSort) }}
{{ end }}
{{ template "type-filter" (dict
"Action" (print "/browse/" .ActiveCategory "/" (pathEscape .Title))
"Params" .Params
"AllTypes" .AllTypes
"SelectedTypes" .SelectedTypes
) }}
</div>
{{ if eq .View "table" }}
{{ template "doc-table" . }}
{{ else }}
<h2 class="sr-only">Documents</h2>
{{ template "doc-cards" .Cards }}
{{ template "pagination" . }}
{{ end }}
{{ end }}
{{ template "base.html" . }}