Ship the Go/SQLite API and Web UI, Chrome/Brave capture addon, Docker Compose, Pangolin reverse-proxy support, and a user-crontab watchdog so the binary stays running without systemd.
105 lines
3.6 KiB
HTML
105 lines
3.6 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>RCS — Reddit Comment Saver</title>
|
|
<link rel="stylesheet" href="/static/style.css">
|
|
</head>
|
|
<body>
|
|
<header class="site-header">
|
|
<div class="brand">
|
|
<h1>RCS</h1>
|
|
<p>Reddit Comment Saver</p>
|
|
</div>
|
|
<form class="search" method="get" action="/">
|
|
<label>
|
|
Username
|
|
<input type="text" name="user" value="{{.User}}" placeholder="spez">
|
|
</label>
|
|
<label>
|
|
Free text (GLOB)
|
|
<input type="text" name="q" value="{{.Query}}" placeholder="*bla*bla*">
|
|
</label>
|
|
<button type="submit">Search</button>
|
|
</form>
|
|
</header>
|
|
|
|
{{if .Error}}
|
|
<div class="banner error">{{.Error}}</div>
|
|
{{end}}
|
|
{{if .Flash}}
|
|
<div class="banner ok">{{.Flash}}</div>
|
|
{{end}}
|
|
|
|
{{if not .ImgurOn}}
|
|
<div class="banner warn">Imgur export is disabled until <code>IMGUR_CLIENT_ID</code> is set on the server.</div>
|
|
{{end}}
|
|
|
|
<main>
|
|
{{if not .Results}}
|
|
<p class="empty">No comments yet. Browse Reddit with the RCS extension connected to this backend.</p>
|
|
{{else}}
|
|
<ul class="results">
|
|
{{range .Results}}
|
|
<li class="result" data-comment-id="{{.RedditCommentID}}">
|
|
<div class="meta">
|
|
<strong>u/{{.AuthorName}}</strong>
|
|
<span class="muted">on</span>
|
|
<span>{{.PostTitle}}</span>
|
|
<a class="permalink" href="{{.Permalink}}" target="_blank" rel="noopener">Reddit</a>
|
|
</div>
|
|
<p class="body">{{snippet .Body}}</p>
|
|
{{if .ScreenshotPath}}
|
|
<div class="shot">
|
|
<button type="button" class="shot-thumb" data-full="{{screenshotURL .ScreenshotPath}}" aria-label="Preview screenshot">
|
|
<img src="{{screenshotURL .ScreenshotPath}}" alt="Comment screenshot" loading="lazy">
|
|
<span class="shot-hint">Click to enlarge</span>
|
|
</button>
|
|
</div>
|
|
{{else}}
|
|
<p class="muted no-shot">No screenshot</p>
|
|
{{end}}
|
|
<div class="actions">
|
|
{{if hasImgur .ImgurURL}}
|
|
<a class="btn" href="{{.ImgurURL}}" target="_blank" rel="noopener">Open on Imgur</a>
|
|
<button type="button" class="btn secondary copy-url" data-url="{{.ImgurURL}}">Copy URL</button>
|
|
<span class="muted copied-hint" hidden>Copied</span>
|
|
{{else}}
|
|
<form method="post" action="/export/{{.RedditCommentID}}">
|
|
<input type="hidden" name="q" value="{{$.Query}}">
|
|
<input type="hidden" name="user" value="{{$.User}}">
|
|
<input type="hidden" name="page" value="{{$.Page}}">
|
|
<button type="submit" class="btn" {{if not $.ImgurOn}}disabled{{end}}>Export to Imgur</button>
|
|
</form>
|
|
{{end}}
|
|
</div>
|
|
</li>
|
|
{{end}}
|
|
</ul>
|
|
<nav class="pager" aria-label="Pagination">
|
|
<span class="pager-meta">Page {{.Page}} of {{.TotalPages}} ({{.Total}} total)</span>
|
|
<div class="pager-links">
|
|
{{if .HasPrev}}
|
|
<a class="btn secondary" href="{{pageURL . .PrevPage}}">Newer</a>
|
|
{{else}}
|
|
<span class="btn secondary disabled">Newer</span>
|
|
{{end}}
|
|
{{if .HasNext}}
|
|
<a class="btn secondary" href="{{pageURL . .NextPage}}">Older</a>
|
|
{{else}}
|
|
<span class="btn secondary disabled">Older</span>
|
|
{{end}}
|
|
</div>
|
|
</nav>
|
|
{{end}}
|
|
</main>
|
|
|
|
<div id="lightbox" class="lightbox" hidden>
|
|
<button type="button" class="lightbox-close" aria-label="Close preview">×</button>
|
|
<img id="lightbox-img" alt="Screenshot preview">
|
|
</div>
|
|
<script src="/static/app.js"></script>
|
|
</body>
|
|
</html>
|