add a page for tickets from gitea (#2)

Co-authored-by: Blake Ridgway <blake@blakeridgway.com>
Reviewed-on: #2
This commit is contained in:
2026-04-13 03:51:22 -05:00
parent 5bc3050dd4
commit b1feff3bbf
16 changed files with 782 additions and 12 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}}

View File

@@ -33,6 +33,7 @@
<li><a href="/status">status</a></li>
<li><a href="/about">about</a></li>
<li><a href="/hire" class="nav-hire">hire me</a></li>
{{if .TwitchLive}}<li><a href="/stream" class="nav-live">&#x25CF; live</a></li>{{end}}
</ul>
</nav>
</header>
@@ -54,6 +55,7 @@
<a href="/changelog">changelog</a> &mdash;
<a href="/blog/feed.xml">RSS</a> &mdash;
<a href="https://git.ridgwaysystems.org">gitea</a> &mdash;
<a href="/stream">stream</a> &mdash;
<a href="/hire">hire me</a>
</p>
</footer>

View File

@@ -9,6 +9,21 @@
{{end}}
</div>
{{if .PlannedOutages}}
<div class="planned-outages">
<h2>Planned Maintenance</h2>
<ul class="outage-list">
{{range .PlannedOutages}}
<li class="outage-item">
<span class="outage-indicator" aria-hidden="true"></span>
<a href="{{.HTMLURL}}" class="outage-link" target="_blank" rel="noopener">{{.Title}}</a>
<span class="outage-num">#{{.Number}}</span>
</li>
{{end}}
</ul>
</div>
{{end}}
{{if .Page.Services}}
<ul class="status-list">
{{range .Page.Services}}

22
templates/stream.html Normal file
View File

@@ -0,0 +1,22 @@
{{define "title"}}Stream &mdash; Ridgway Systems{{end}}
{{define "meta-desc"}}Watch the Ridgway Systems live stream.{{end}}
{{define "content"}}
<div class="page-header">
<h1>Live Stream</h1>
{{if .Live}}
<p class="page-desc"><span class="live-badge">&#x25CF; live</span> Streaming now on Twitch.</p>
{{else}}
<p class="page-desc">Not currently live. Follow on <a href="https://twitch.tv/{{.Channel}}" target="_blank" rel="noopener">Twitch</a> to get notified.</p>
{{end}}
</div>
<div class="stream-player">
<iframe
src="https://player.twitch.tv/?channel={{.Channel}}&parent={{.Parent}}&autoplay=false"
height="100%"
width="100%"
allowfullscreen>
</iframe>
</div>
{{end}}