first commit
This commit is contained in:
51
templates/admin/dashboard.html
Normal file
51
templates/admin/dashboard.html
Normal 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}}
|
||||
Reference in New Issue
Block a user