first commit

This commit is contained in:
Blake Ridgway
2026-04-11 14:01:09 -05:00
commit 6915cab5f3
22 changed files with 1842 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
{{define "title"}}admin — paste.ridgwaysystems.org{{end}}
{{define "content"}}
{{$csrf := .CSRFToken}}
<div class="admin-wrap">
<div class="admin-header">
<h1>all pastes</h1>
<div class="admin-actions">
<a href="/new" class="btn">+ new paste</a>
</div>
</div>
{{if .Pastes}}
<table class="admin-table">
<thead>
<tr>
<th>id</th>
<th>title</th>
<th>language</th>
<th>created</th>
<th>expires</th>
<th>unlisted</th>
<th>actions</th>
</tr>
</thead>
<tbody>
{{range .Pastes}}
<tr {{if .Expired}}style="opacity:0.5"{{end}}>
<td><code><a href="/{{.ID}}">{{.ID}}</a></code></td>
<td>{{.Title}}</td>
<td><span class="lang-badge">{{.Language}}</span></td>
<td class="post-date">{{formatDate .CreatedAt}}</td>
<td class="post-date">{{expiryStr .}}</td>
<td>{{if .Unlisted}}<span class="tag">unlisted</span>{{end}}</td>
<td class="actions-cell">
<a href="/raw/{{.ID}}" class="btn btn-outline btn-sm">raw</a>
<form method="POST" action="/admin/delete/{{.ID}}" class="inline-form"
onsubmit="return confirm('Delete paste {{.ID}}?')">
<input type="hidden" name="csrf_token" value="{{$csrf}}">
<button type="submit" class="btn btn-danger btn-sm">delete</button>
</form>
</td>
</tr>
{{end}}
</tbody>
</table>
{{else}}
<p class="empty-state">No pastes yet. <a href="/new">Create one.</a></p>
{{end}}
</div>
{{end}}

View File

@@ -0,0 +1,18 @@
{{define "title"}}login — paste.ridgwaysystems.org{{end}}
{{define "content"}}
<div class="admin-login-wrap">
<h1>admin login</h1>
{{if .Error}}
<div class="form-error">{{.Error}}</div>
{{end}}
<form method="POST" action="/admin/login" class="login-form">
<input type="hidden" name="csrf_token" value="{{.CSRFToken}}">
<label for="password">password</label>
<input type="password" id="password" name="password" autofocus autocomplete="current-password">
<button type="submit" class="btn">login</button>
</form>
</div>
{{end}}