snowchive-server/templates/doc.html
2026-11-19 04:40:59 +02:00

272 lines
15 KiB
HTML

{{ define "title" }}{{ .Doc.Title }} - Snowden Archive{{ end }}
{{ define "head" }}
<meta name="description" content="{{ .Doc.Description }}">
<link rel="schema.DC" href="http://purl.org/dc/elements/1.1/">
<meta name="DC.title" content="{{ .Doc.Title }}">
{{ if .Doc.DocMeta.Creator }}<meta name="DC.creator" content="{{ .Doc.DocMeta.Creator }}">{{ end }}
{{ if .Doc.DocMeta.DateCreated }}<meta name="DC.date" content="{{ .Doc.DocMeta.DateCreated }}">{{ end }}
{{ if .Doc.Description }}<meta name="DC.description" content="{{ .Doc.Description }}">{{ end }}
{{ range .Doc.DocMeta.Programs }}<meta name="DC.subject" content="{{ . }}">{{ end }}
{{ range .Doc.Tags }}<meta name="DC.subject" content="{{ . }}">{{ end }}
<meta name="DC.type" content="Text">
<meta name="DC.format" content="application/pdf">
<meta name="DC.identifier" content="{{ .DocAbsURL }}">
<meta name="DC.language" content="en">
<meta name="DC.publisher" content="Snowden Archive">
<meta property="og:type" content="article">
<meta property="og:site_name" content="Snowden Archive">
<meta property="og:title" content="{{ .Doc.Title }}">
{{ if .Doc.Description }}<meta property="og:description" content="{{ .Doc.Description }}">{{ end }}
<meta property="og:url" content="{{ .DocAbsURL }}">
{{ with .OGImageURL }}<meta property="og:image" content="{{ . }}">{{ end }}
<meta name="twitter:card" content="summary">
{{ if .APIEnabled }}<link rel="alternate" type="application/json" href="/api/doc/{{ .Doc.ID }}">{{ end }}
{{ .Embeds.JSONLDTag }}
{{ end }}
{{ define "content" }}
{{ $sidebar := .Prefs.InfoSidebar }}
<div class="doc-layout{{ if $sidebar }} info-sidebar{{ end }}">
{{ if $sidebar }}
<input type="checkbox" id="info-collapse" class="info-collapse-checkbox">
{{ end }}
<header class="doc-header">
<div class="header-main">
<div>
<h1>{{ .Doc.Title }}</h1>
<a href="/files/{{ .Doc.ID }}/{{ pathEscape .Doc.PDFFile }}" target="_blank" rel="noopener"
class="doc-top-btn doc-pdf-link" title="Open original PDF">Open PDF</a>
{{ with .Doc.Versions }}<a href="#publications" class="doc-top-btn" title="Other published copies of this document: less redacted, extra pages or a different scan">+{{ len . }} other cop{{ if eq (len .) 1 }}y{{ else }}ies{{ end }}</a>{{ end }}
<form method="POST" action="/pin/{{ .Doc.ID }}" class="inline-form">
{{ $back := print "/doc/" .Doc.ID }}
<input type="hidden" name="back" value="{{ $back }}">
<button type="submit" class="doc-top-btn pin-btn">{{ if .Pinned }}&#9733; Unpin{{ else }}&#9734; Pin{{ end }}</button>
</form>
{{ if or .SerialPrev .SerialNext }}
<nav class="serial-nav" aria-label="SIDtoday issues">
{{ with .SerialPrev }}<a href="/doc/{{ .ID }}" class="serial-prev" title="{{ .Title }}">&larr; Previous issue{{ with .DocMeta.DateCreated }} ({{ . }}){{ end }}</a>{{ end }}
{{ with .SerialNext }}<a href="/doc/{{ .ID }}" class="serial-next" title="{{ .Title }}">Next issue{{ with .DocMeta.DateCreated }} ({{ . }}){{ end }} &rarr;</a>{{ end }}
</nav>
{{ end }}
<div class="doc-info">
<strong>Creating agency:</strong> {{ with .Doc.DocMeta.Creator }}<a href="/browse/agency/{{ pathEscape . }}{{ $.BrowseQS }}">{{ . }}</a>{{ with agencyName . }} <small class="muted">{{ . }}</small>{{ end }}{{ else }}-{{ end }}<br>
<strong>Document date:</strong> {{ with .Doc.DocMeta.DateCreated }}{{ . }}{{ else }}-{{ end }}<br>
{{ if or (eq .Doc.Type "FOIA") (eq .Doc.Type "SIDTODAY") }}<strong>Type:</strong> {{ template "type-badge" .Doc.Type }}<br>{{ end }}
{{ if .Doc.Pages }}<strong>Pages:</strong> <a href="/doc/{{ .Doc.ID }}/pages">{{ .Doc.Pages }}</a><br>{{ end }}
{{ with .Doc.DocMeta.Genre }}<strong>Genre:</strong> <a href="/browse/genre/{{ pathEscape . }}{{ $.BrowseQS }}">{{ . }}</a><br>{{ end }}
{{ with .Doc.DocMeta.Banner }}<strong>Banner:</strong> <a href="/browse/banner/{{ pathEscape . }}{{ $.BrowseQS }}" class="doc-banner-link banner">{{ . }}</a><br>{{ end }}
<strong>Classification: </strong>
{{- facetLinks (dict "Vals" .Doc.DocMeta.Classification "Cat" "classification" "Sep" "space" "Class" "tag classification" "QS" $.BrowseQS) -}}
<br>
<strong>Dissemination: </strong>
{{- facetLinks (dict "Vals" .Doc.DocMeta.Dissemination "Cat" "dissemination" "Class" "doc-banner-link dissemination" "QS" $.BrowseQS) -}}
</div>
{{ with .SeriesGroup }}
<div class="rule-top series-box">
<strong>Series:</strong>
<a href="/browse/series/{{ pathEscape .Name }}{{ $.BrowseQS }}">{{ .Name }}</a>
<ol class="series-list">
{{ range .Docs }}
<li{{ if gt .DocMeta.Series.Part 0 }} value="{{ .DocMeta.Series.Part }}"{{ end }}>
{{ if eq .ID $.Doc.ID }}<strong aria-current="page">{{ .Title }}</strong>
{{ else }}<a href="/doc/{{ .ID }}">{{ .Title }}</a>{{ end }}
</li>
{{ end }}
</ol>
</div>
{{ end }}
{{ with .Assemblies }}
<div class="rule-top series-box">
<strong>Part of {{ if gt (len .) 1 }}assemblies{{ else }}an assembly{{ end }}:</strong>
{{ range $i, $a := . }}{{ if $i }}, {{ end }}<a href="/explore/assemblies/{{ $a.ID }}">{{ $a.Title }}</a>{{ end }}
</div>
{{ end }}
<div class="rule-top pub-block" id="publications">
{{- range $i, $pub := .Doc.Publication }}
<div class="pub-entry{{ if $i }} pub-sep{{ end }}">
{{- if or $pub.Link $pub.Publisher $pub.DatePublished }}
<div class="pub-head">
{{- if $pub.Link }}<a href="{{ $pub.Link }}" target="_blank" rel="noopener" class="pub-original">{{ with $pub.Publisher }}{{ . }}{{ else }}Read the original{{ end }} &nearr;</a>
{{- else }}{{ with $pub.Publisher }}<span class="pub-outlet">{{ . }}</span>{{ end }}{{ end -}}
{{- with $pub.DatePublished }}<span class="pub-date muted">{{ . }}</span>{{ end -}}
</div>
{{- end -}}
{{- if $pub.Title -}}
{{ $ak := articleKey $pub.Link }}
<div class="pub-title">{{ if $ak }}<a href="/article/{{ $ak }}"><em>{{ $pub.Title }}</em></a>{{ else }}<em>{{ $pub.Title }}</em>{{ end }}</div>
{{- end -}}
{{- if or $pub.Journalists $pub.Contributors }}
<div class="pub-people muted">
{{- range $j, $name := $pub.Journalists -}}
{{- if $j }} <span class="doc-dot">&middot;</span> {{ end -}}
<a href="/browse/journalist/{{ pathEscape $name }}{{ $.BrowseQS }}" class="meta-link">{{ $name }}</a>
{{- end -}}
{{- range $j, $name := $pub.Contributors -}}
{{- if or $j $pub.Journalists }} <span class="doc-dot">&middot;</span> {{ end -}}
<span class="meta-link">{{ $name }}</span>
{{- end -}}
</div>
{{- end -}}
{{- if $pub.ReportingOnly }}
<div class="pub-reporting-only muted">Reporting partner - published this story, not the document</div>
{{- end -}}
{{- with $pub.Note }}
<div class="pub-note">{{ . }}</div>
{{- end -}}
{{- $copy := $.Doc.VersionFor $pub.Version -}}
{{- $shown := and (not $pub.ReportingOnly) (not $pub.Version) $.Doc.Versions -}}
{{- if and (not $pub.ReportingOnly) (or $copy $pub.DocSource $pub.DocURL $shown) }}
<div class="pub-copy muted">
{{- if $shown }}<span class="pub-shown">the copy shown on this page</span>{{ end -}}
{{- with $copy }}<a href="/doc/{{ $.Doc.ID }}/versions/{{ .Slug }}">view this copy &rarr;</a>{{ if .ChangedPages }}<span class="changed-pages">changed pages: {{ template "changed-page-links" . }}</span>{{ end }}{{ end -}}
{{- with $pub.DocSource }}<a href="{{ . }}" target="_blank" rel="noopener">document page &nearr;</a>{{ end -}}
{{- with $pub.DocURL }}<a href="{{ . }}" target="_blank" rel="noopener">original PDF &nearr;</a>{{ end -}}
</div>
{{- end -}}
</div>
{{- end }}
{{- with .Doc.UnlinkedVersions }}
<div class="pub-entry pub-sep">
<div class="pub-title">Other copies</div>
<div class="pub-copy muted">
{{- range . }}<span><a href="/doc/{{ $.Doc.ID }}/versions/{{ .Slug }}">{{ .Slug }} &rarr;</a>{{ if .ChangedPages }} (changed pages: {{ template "changed-page-links" . }}){{ end }}</span>{{ end -}}
</div>
</div>
{{- end }}
</div>
<div class="rule-top">
<p>{{ .Doc.Description }}</p>
<div class="meta-expand">
<input type="checkbox" id="meta-toggle" class="meta-checkbox"{{ if .Prefs.OpenInfo }} checked{{ end }}>
<label for="meta-toggle" class="meta-label">
<span class="collapsed-text">[+] Show more info</span>
<span class="expanded-text">[-] Show less info</span>
<span class="sr-only">Toggle extended document metadata</span>
</label>
<div class="meta-content">
<div class="meta-grid">
<div class="meta-wide long-desc-container">
<strong>Long Description:</strong>
<div class="long-description-text">
{{- with .Doc.LongDescription }}{{ . }}{{ else }}<em>No extended description available.</em>{{ end -}}
</div>
</div>
<div>
<strong>Programs:</strong><br>
{{- facetLinks (dict "Vals" .Doc.DocMeta.Programs "Cat" "program" "Class" "tag" "AsList" .Prefs.ProgramsAsList "QS" $.BrowseQS) -}}
{{- if not (and .Doc.DocMeta.Programs .Prefs.ProgramsAsList) }}<br>{{ end -}}
<br>
<strong>People mentioned:</strong><br>
{{- facetLinks (dict "Vals" .Doc.DocMeta.People "Cat" "people" "Class" "meta-link" "QS" $.BrowseQS) -}}
<br><br>
<strong>Countries:</strong><br>
{{- facetLinks (dict "Vals" .Doc.DocMeta.Countries "Cat" "country" "Class" "meta-link" "QS" $.BrowseQS) -}}
<br><br>
<strong>Tags:</strong><br>
{{- facetLinks (dict "Vals" .Doc.Tags "Cat" "tag" "Class" "meta-link" "AsList" .Prefs.TagsAsList "QS" $.BrowseQS) -}}
<br><br>
<strong>Identifier:</strong><br>
<code class="checksum">{{ .Doc.ID }}</code>
{{ with .Doc.AkaID }}
<br><strong>Also known as:</strong><br>
{{ range $i, $aka := . }}{{ if $i }}<br>{{ end }}<code class="checksum">{{ $aka.ID }}</code>{{ with $aka.DocSource }} <a href="{{ . }}" target="_blank" rel="noopener">page &nearr;</a>{{ end }}{{ with $aka.DocURL }} <a href="{{ . }}" target="_blank" rel="noopener">PDF &nearr;</a>{{ end }}{{ end }}
{{ end }}
{{ with .Doc.PDFSha256 }}
<br><br>
<strong>PDF SHA-256:</strong><br>
<code class="checksum">{{ . }}</code>
{{ end }}
</div>
</div>
</div>
</div>
<details class="note-box note-subtle" id="note-box" hidden data-doc-id="{{ .Doc.ID }}" data-doc-title="{{ .Doc.Title }}">
<summary>My notes <span class="note-status faint" id="note-status"></span></summary>
<textarea id="note-text" rows="4" placeholder="Private notes about this document - stored only in this browser (localStorage). See all your notes on the Pinned page."></textarea>
</details>
</div>
</div>
</div>
</header>
{{ if $sidebar }}
<label for="info-collapse" class="info-toggle-label" title="Show/hide document info">
<span class="sr-only">Toggle the document info sidebar</span>
</label>
{{ end }}
<div class="doc-container">
{{ template "doc-viewport" . }}
</div>
</div>{{/* /.doc-layout */}}
{{ if and .Images (not .Prefs.TextOnly) }}
{{ template "lightbox-overlays" . }}
{{ end }}
<div class="doc-extra">
{{ with .Doc.ArchiveComment }}
<div class="archive-note">
<strong>Archive note:</strong> {{ . }}
</div>
{{ end }}
<span class="Z3988" title="{{ .Embeds.COinS }}"></span>
</div>
{{ if or .PublishedTogether .RelatedDocs }}
<div class="related-section">
{{ if .PublishedTogether }}
<details class="collapse-section"{{ if not $.Prefs.CollapsePubTogether }} open{{ end }}>
<summary>
<span class="collapse-ind" aria-hidden="true"></span>
<h2>Published in the Same Report
<small>{{ if .PublishedMore }}({{ .PublishedShown }} of {{ len .PublishedTogether }} documents){{ else }}({{ len .PublishedTogether }} documents){{ end }}</small>
</h2>
</summary>
{{ template "doc-cards" .PublishedCards }}
{{ with .PublishedMore }}{{ $one := eq (len .) 1 }}
{{ range . }}
<p class="pub-more"><a class="see-all" href="/article/{{ .Key }}">See all {{ len .DocIDs }} documents published with {{ if $one }}this article{{ else if .Title }}&ldquo;{{ .Title }}&rdquo;{{ else }}the article at {{ .Host }}{{ end }} &rarr;</a></p>
{{ end }}
{{ end }}
</details>
{{ end }}
{{ if .RelatedDocs }}
<details class="collapse-section"{{ if not $.Prefs.CollapseRelated }} open{{ end }}>
<summary>
<span class="collapse-ind" aria-hidden="true"></span>
<h2>Related Documents</h2>
</summary>
{{ template "doc-cards" .RelatedCards }}
</details>
{{ end }}
</div>
{{ end }}
{{ end }}
{{ template "base.html" . }}