add a page for tickets from gitea

This commit is contained in:
Blake Ridgway
2026-04-11 13:15:22 -05:00
parent 5bc3050dd4
commit 0ba2f7af4e
11 changed files with 471 additions and 6 deletions

View File

@@ -10,6 +10,7 @@
<a href="/admin/uploads" class="btn btn-outline">Uploads</a>
<a href="/admin/newsletter" class="btn btn-outline">Newsletter</a>
<a href="/admin/changelog" class="btn btn-outline">Changelog</a>
<a href="/admin/outages" class="btn btn-outline">Outages</a>
<a href="/" class="btn btn-outline">View Site</a>
<form method="POST" action="/admin/logout" class="inline-form">
<button type="submit" class="btn btn-outline">Logout</button>

View File

@@ -0,0 +1,63 @@
{{define "title"}}Planned Outages &mdash; Admin{{end}}
{{define "content"}}
<div class="admin-wrap">
<div class="admin-header">
<h1>Planned Outages</h1>
<div class="admin-actions">
<a href="/admin" class="btn btn-outline">Back</a>
<a href="/admin/outages" class="btn btn-outline">Refresh</a>
</div>
</div>
{{if .Flash}}<p class="flash-msg">{{.Flash}}</p>{{end}}
{{if .Error}}<p class="form-error">{{.Error}}</p>{{end}}
{{if .Issues}}
<p class="page-desc">Tag open tickets with <code>{{.Label}}</code> to mark them as planned outages.</p>
<table class="hw-table">
<thead>
<tr>
<th>#</th>
<th>Title</th>
<th>Labels</th>
<th>Action</th>
</tr>
</thead>
<tbody>
{{range .Issues}}
{{$tagged := .HasLabel $.Label}}
<tr class="{{if $tagged}}outage-tagged{{end}}">
<td class="hw-spec">
<a href="{{.HTMLURL}}" target="_blank" rel="noopener">#{{.Number}}</a>
</td>
<td>{{.Title}}</td>
<td>
{{range .Labels}}
<span class="changelog-category">{{.Name}}</span>
{{end}}
</td>
<td>
{{if $tagged}}
<form method="POST" action="/admin/outages" class="inline-form">
<input type="hidden" name="action" value="remove">
<input type="hidden" name="issue" value="{{.Number}}">
<button type="submit" class="btn btn-sm btn-danger">Remove tag</button>
</form>
{{else}}
<form method="POST" action="/admin/outages" class="inline-form">
<input type="hidden" name="action" value="add">
<input type="hidden" name="issue" value="{{.Number}}">
<button type="submit" class="btn btn-sm">Tag as outage</button>
</form>
{{end}}
</td>
</tr>
{{end}}
</tbody>
</table>
{{else if not .Error}}
<p class="empty-state">No open issues found.</p>
{{end}}
</div>
{{end}}