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

View file

@ -0,0 +1,97 @@
{{ define "title" }}Preferences - Snowden Archive{{ end }}
{{ define "content" }}
<h1>Preferences</h1>
<p class="muted">Preferences are saved in browser cookies.</p>
{{ if .Saved }}<p class="pref-saved">Settings saved.</p>{{ end }}
{{ if .Reset }}<p class="pref-saved">Preferences reset to defaults.</p>{{ end }}
<form action="/preferences/save" method="POST" class="pref-form">
<fieldset>
<legend>Theme</legend>
<label><input type="radio" name="theme" value="auto" {{ if eq .Prefs.Theme "auto" }}checked{{ end }}> Auto (follow browser)</label>
<label><input type="radio" name="theme" value="light" {{ if eq .Prefs.Theme "light" }}checked{{ end }}> Light</label>
<label><input type="radio" name="theme" value="dark" {{ if eq .Prefs.Theme "dark" }}checked{{ end }}> Dark</label>
<label><input type="checkbox" name="text_only" value="1" {{ if .Prefs.TextOnly }}checked{{ end }}> Text-only mode - no thumbnails or page images, links instead</label>
</fieldset>
<fieldset>
<legend>Browse lists</legend>
<label>Documents per page:
<select name="per_page">
<option value="10" {{ if eq .Prefs.PerPage 10 }}selected{{ end }}>10</option>
<option value="20" {{ if eq .Prefs.PerPage 20 }}selected{{ end }}>20</option>
<option value="50" {{ if eq .Prefs.PerPage 50 }}selected{{ end }}>50</option>
<option value="100" {{ if eq .Prefs.PerPage 100 }}selected{{ end }}>100</option>
<option value="all" {{ if eq .Prefs.PerPage 0 }}selected{{ end }}>All (up to {{ .MaxCards }} a page)</option>
</select>
</label>
<label><input type="checkbox" name="hide_classification" value="1" {{ if not .Prefs.ShowClassification }}checked{{ end }}> Hide classification and dissemination markings on document cards</label>
<label><input type="checkbox" name="hide_journalists" value="1" {{ if not .Prefs.ShowJournalists }}checked{{ end }}> Hide journalist names on document cards</label>
<label><input type="checkbox" name="hide_people" value="1" {{ if not .Prefs.ShowPeople }}checked{{ end }}> Hide the people line on document cards</label>
<label><input type="checkbox" name="hide_programs" value="1" {{ if not .Prefs.ShowPrograms }}checked{{ end }}> Hide program names on document cards</label>
<label><input type="checkbox" name="hide_summary" value="1" {{ if not .Prefs.ShowSummary }}checked{{ end }}> Hide short summaries on document cards</label>
<label><input type="checkbox" name="hide_thumbs" value="1" {{ if not .Prefs.ShowThumbs }}checked{{ end }}> Hide thumbnails on search results and document cards</label>
<label><input type="checkbox" name="show_coll_cols" value="1" {{ if .Prefs.ShowCollCols }}checked{{ end }}> Always show the per-type count columns on category tables <span class="muted pref-note">(Reported / SIDtoday / FOIA breakdown - otherwise behind a toggle on each table)</span></label>
<label><input type="checkbox" name="page_preview" value="1" {{ if .Prefs.CardPagePreview }}checked{{ end }}> Page preview on card-thumbnail hover <span class="muted pref-note">(desktop only - hover a thumbnail to preview the full pages; press h / l or the arrow keys to flip pages.)</span></label>
</fieldset>
<fieldset>
<legend>FOIA releases</legend>
<label><input type="checkbox" name="include_foia" value="1" {{ if .Prefs.IncludeFOIA }}checked{{ end }}> Include FOIA releases <span class="muted pref-note">(official releases from FOIA litigation and FISC and ODNI declassifications, not Snowden documents)</span></label>
</fieldset>
<fieldset>
<legend>Document layout</legend>
<label>Default view:
<select name="doc_view">
<option value="images" {{ if eq .Prefs.DocView "images" }}selected{{ end }}>Images only</option>
<option value="split" {{ if eq .Prefs.DocView "split" }}selected{{ end }}>Split view (images + text)</option>
<option value="text" {{ if eq .Prefs.DocView "text" }}selected{{ end }}>Text only</option>
</select>
</label>
<label>Document info:
<select name="info_position">
<option value="above" {{ if not .Prefs.InfoSidebar }}selected{{ end }}>Above the document</option>
<option value="beside" {{ if .Prefs.InfoSidebar }}selected{{ end }}>Beside the document (sidebar)</option>
</select>
<span class="muted pref-note">(desktop only)</span>
</label>
<label><input type="checkbox" name="scroll_doc" value="1" {{ if .Prefs.ScrollDoc }}checked{{ end }}> Scroll within the document panes <span class="muted pref-note">(cap the image/text area height instead of letting a long document stretch the page; ignored when the info sidebar is on)</span></label>
</fieldset>
<fieldset>
<legend>Document details</legend>
<label><input type="checkbox" name="open_info" value="1" {{ if .Prefs.OpenInfo }}checked{{ end }}> Expand &ldquo;More info&rdquo; by default</label>
<label><input type="checkbox" name="collapse_pub" value="1" {{ if .Prefs.CollapsePubTogether }}checked{{ end }}> Collapse &ldquo;Published in the same report&rdquo; by default</label>
<label><input type="checkbox" name="collapse_related" value="1" {{ if .Prefs.CollapseRelated }}checked{{ end }}> Collapse &ldquo;Related documents&rdquo; by default</label>
<label><input type="checkbox" name="programs_list" value="1" {{ if .Prefs.ProgramsAsList }}checked{{ end }}> Show programs one per line <span class="muted pref-note">(instead of comma-separated)</span></label>
<label><input type="checkbox" name="tags_list" value="1" {{ if .Prefs.TagsAsList }}checked{{ end }}> Show tags one per line <span class="muted pref-note">(instead of comma-separated)</span></label>
</fieldset>
<fieldset>
<legend>History <span class="muted pref-note">(off by default - nothing is recorded unless you opt in; saved in this browser's cookies; turning this off deletes the history)</span></legend>
<label><input type="checkbox" name="track_recent" value="1" {{ if .Prefs.TrackRecent }}checked{{ end }}> Remember recently viewed documents (shown on the home page)</label>
<label><input type="checkbox" name="track_searches" value="1" {{ if .Prefs.TrackSearches }}checked{{ end }}> Remember recent searches (shown on the search page)</label>
</fieldset>
<div class="pref-actions">
<button type="submit" class="pref-save">Save preferences</button>
<button type="submit" name="reset" value="1" class="pref-reset">Reset to defaults</button>
</div>
</form>
<details id="custom-css-details" class="custom-css-details" hidden>
<summary>Custom CSS <span class="muted pref-note">(for advanced users)</span></summary>
<p class="muted pref-note">Stored only in the localStorage and applied on every page. To turn it off, empty the box and save. If a bad rule ever makes the site unusable, open any page with <code>?nocss=1</code> (e.g. <code>/preferences?nocss=1</code>).</p>
<textarea id="custom-css" rows="8" spellcheck="false" placeholder="/* e.g. */
.prose { font-size: 1.05rem; line-height: 1.8; }
.doc-card { border-width: 2px; }"></textarea>
<div class="custom-css-actions">
<button type="button" id="custom-css-save" class="ctl">Save CSS</button>
<span class="custom-css-status faint" id="custom-css-status"></span>
</div>
</details>
{{ end }}
{{ template "base.html" . }}