Files
Claude 114e56c928 Image boards: an archive of pruned threads
As 4chan's, a thread pruned off a board's last page is archived, not
deleted: off the board's pages and catalog, whole, its files kept,
read-only.  No one replies to it, staff neither (store.AddPost refuses
too, for a reply already on its way); its posts are not deleted by
their passwords (staff still can).  Its page says it is archived in
place of the form and its first post wears a badge.

- /chan/b/archive lists a board's archived threads, the last first;
  /chan/b/archive.json is 4chan's (the numbers, oldest first); an
  archived thread's JSON has archived and archived_on, and boards.json
  is_archived
- [chan] archive_days (3; 0: always) is how long they stay: then they
  are deleted with their files, looked to when a thread is made and
  when the archive or the thread is looked at
- a board's archive setting (bbs chan board set DIR archive no) prunes
  as before, deleting at once; boards have one by default, as do
  those of an older database
- the terminals: a board's thread list has Archive (A), to read them;
  archived threads offer no reply

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
2026-10-14 18:17:57 +00:00

65 lines
6.5 KiB
HTML

{{define "top"}}<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{.Title}}</title>
<link rel="stylesheet" href="/chan/static/chan.css">
<link rel="stylesheet" href="/chan/static/{{.Style}}.css" id="stylesheet">
<script src="/chan/static/chan.js" defer></script>
<script src="/chan/static/oekaki.js" defer></script>
</head>
<body class="{{.Style}}{{with .Board}} board-{{.Dir}}{{end}}">
<div class="boardNav">
<span class="boardList">[{{range $i, $b := .Boards}}{{if $i}} / {{end}}<a href="/chan/{{$b.Dir}}/" title="{{$b.Title}}">{{$b.Dir}}</a>{{end}}]</span>
<span class="navRight">
[<a href="/chan/">Home</a>]
{{if .User}}[{{.User.Name}}{{if .AnyStaff}} &middot; <a href="/chan/manage">Manage</a>{{end}} &middot; <form class="inline" method="post" action="/chan/logout"><input type="hidden" name="tok" value="{{.Token}}"><button class="linkish">Sign out</button></form>]
{{else}}[<a href="/chan/login?back={{.Path}}">Sign in</a>]{{end}}
<form class="inline styleSwitch" method="post" action="/chan/style"><input type="hidden" name="back" value="{{.Path}}">
<label>Style: <select name="style">{{range .Styles}}<option value="{{.Name}}"{{if eq .Name $.Style}} selected{{end}}>{{.Title}}</option>{{end}}</select></label>
<button class="go">Go</button></form>
</span>
</div>
{{with .Notice}}<div class="notice">{{.}}</div>{{end}}
{{end}}
{{define "bottom"}}
<div class="footer">
<div class="boardList">[{{range $i, $b := .Boards}}{{if $i}} / {{end}}<a href="/chan/{{$b.Dir}}/" title="{{$b.Title}}">{{$b.Dir}}</a>{{end}}]</div>
<div class="credit">{{.BBS}} &middot; image boards after kusaba&nbsp;x and 4chan &middot; all posts are the responsibility of their posters</div>
{{with .GeoCredit}}<div class="credit geoCredit">{{if $.GeoCreditURL}}<a href="{{$.GeoCreditURL}}" rel="noopener">{{.}}</a>{{else}}{{.}}{{end}}</div>{{end}}
</div>
</body>
</html>
{{end}}
{{define "banner"}}{{with .Board}}<div class="boardBanner">
<div class="boardTitle">/{{.Dir}}/ - {{.Title}}</div>
{{with .Description}}<div class="boardSubtitle">{{.}}</div>{{end}}
</div>{{end}}{{end}}
{{define "file"}}<div class="file" id="f{{.No}}">
{{if .FileDeleted}}<span class="fileDeleted">File deleted.</span>
{{else}}{{$kind := kind .Ext}}<div class="fileText">File: <a href="{{.SrcURL}}" target="_blank" title="{{.FileName}}{{.Ext}}">{{short (print .FileName .Ext)}}</a> ({{if .Spoiler}}Spoiler {{if eq $kind "image"}}Image{{else if eq $kind "video"}}Video{{else}}File{{end}}, {{end}}{{size .FileSize}}, {{if eq $kind "pdf"}}PDF{{with .PageCount}}, {{.}} {{if eq . 1}}page{{else}}pages{{end}}{{end}}{{else}}{{.W}}x{{.H}}{{end}}{{if eq .Ext ".swf"}}, Flash{{end}}{{if and (or (eq $kind "video") (eq .Ext ".flv")) .DurationMS}}, {{clock .DurationMS}}{{end}}){{if .Replay}} <span class="oekakiInfo">&middot; drawn in {{dur .DrawMS}} <span class="jsonly">[<a href="{{.SrcURL}}" class="replayLink" data-no="{{.No}}">Replay</a>]{{if .Draw}} [<a href="/chan/{{.Dir}}/thread/{{.Thread}}?draw={{.No}}#postForm" class="drawOver" data-src="{{.SrcURL}}" data-thread="{{.Thread}}">Draw over</a>]{{end}}</span></span>{{end}}</div>
<a class="fileThumb{{if .Spoiler}} imgspoiler{{end}}{{if and (ne $kind "image") (or (ne $kind "flash") .Play)}} {{$kind}}Thumb{{end}}" href="{{.SrcURL}}" target="_blank"{{if eq $kind "pdf"}} rel="noopener"{{end}}{{if .Play}} data-flash="{{.Ext}}" data-w="{{.W}}" data-h="{{.H}}"{{end}}>{{if .Spoiler}}<img src="/chan/static/spoiler.png" alt="Spoiler Image" width="100" height="100">{{else}}<img src="{{.ThumbURL}}" alt="{{size .FileSize}}" width="{{.TnW}}" height="{{.TnH}}" loading="lazy">{{end}}</a>
{{end}}</div>{{end}}
{{define "post"}}<div class="postContainer {{if .OP}}opContainer{{else}}replyContainer{{end}}" id="pc{{.No}}">
{{if not .OP}}<div class="sideArrows">&gt;&gt;</div>{{end}}
<div id="p{{.No}}" class="post {{if .OP}}op{{else}}reply{{end}}"{{with .PosterID}} data-id="{{.}}"{{end}}>
{{if and .OP .Ext}}{{template "file" .}}{{end}}
<div class="postInfo" id="pi{{.No}}">
<input type="checkbox" name="{{.No}}" value="delete" form="delform" aria-label="Choose post {{.No}}">
{{with .Subject}}<span class="subject">{{.}}</span>{{end}}
<span class="nameBlock{{with .Capcode}} capcode-{{.}}{{end}}">{{if .Email}}<a href="mailto:{{.Email}}" class="useremail">{{end}}<span class="name{{if .Account}} account{{end}}">{{.Name}}</span>{{with .Trip}} <span class="postertrip">{{.}}</span>{{end}}{{if .Email}}</a>{{end}}{{if .Account}} <span class="memberMark signed" title="Signed: {{.Account}}, a user of this BBS">&#10003;</span>{{else if .UserID}} <span class="memberMark" title="Posted by a signed-in user of this BBS">&#10003;</span>{{end}}{{with .Capcode}} <strong class="capcode">## {{if eq . "admin"}}Admin{{else}}Mod{{end}}</strong>{{end}}{{with .PosterID}} <span class="posteruid">(ID: <span class="hand {{idc .}}" data-id="{{.}}" title="{{if $.IDCount}}{{$.IDCount}} {{if eq $.IDCount 1}}post{{else}}posts{{end}} by this ID; {{end}}click to highlight them">{{.}}</span>)</span>{{end}}{{with .Country}} <span class="flag" title="{{$.CountryName}}">{{flag .}}</span>{{end}}</span>
<span class="dateTime" title="{{iso .Created}}">{{date .Created}}</span>
<span class="postNum"><a href="/chan/{{.Dir}}/thread/{{.Thread}}#p{{.No}}" title="Link to this post">No.</a><a href="/chan/{{.Dir}}/thread/{{.Thread}}?quote={{.No}}#postForm" class="quotePost" data-no="{{.No}}" title="Reply to this post">{{.No}}</a>{{if .Sticky}} <span class="badge sticky" title="Sticky">Sticky</span>{{end}}{{if .Closed}} <span class="badge closed" title="Closed">Closed</span>{{end}}{{if and .OP (not .Archived.IsZero)}} <span class="badge archived" title="Archived {{date .Archived}}">Archived</span>{{end}}{{if and .OP .Index}} &nbsp; <span>[<a href="/chan/{{.Dir}}/thread/{{.No}}" class="replylink">Reply</a>]</span>{{end}}</span>
<a class="reportLink" href="/chan/{{.Dir}}/report?no={{.No}}" title="Report this post" rel="nofollow">&#9656;</a>{{if .Staff}} <a class="modLink" href="/chan/manage/post?b={{.Dir}}&amp;no={{.No}}" title="Moderate">[M]</a>{{end}}
{{with .Backlinks}}<div class="backlink">{{range .}}<span><a href="#p{{.}}" class="quotelink" data-no="{{.}}">&gt;&gt;{{.}}</a></span> {{end}}</div>{{end}}
</div>
{{if and (not .OP) .Ext}}{{template "file" .}}{{end}}
<blockquote class="postMessage" id="m{{.No}}">{{.Comment}}{{if .Cut}}<span class="abbr"><br>Comment too long. <a href="/chan/{{.Dir}}/thread/{{.Thread}}#p{{.No}}">Click here</a> to view the full text.</span>{{end}}{{if .Banned}}<br><br><strong class="banMessage">(USER WAS BANNED FOR THIS POST)</strong>{{end}}</blockquote>
</div>
</div>{{end}}