Init
This commit is contained in:
28
web/templates/admin.html
Normal file
28
web/templates/admin.html
Normal file
@@ -0,0 +1,28 @@
|
||||
{{template "layout" .}}
|
||||
|
||||
{{define "title"}}Admin Panel · Estus Shots{{end}}
|
||||
|
||||
{{define "content"}}
|
||||
<fieldset class="tui-fieldset" style="padding: 2rem;">
|
||||
<legend>Admin Panel</legend>
|
||||
<p class="tui-text-white">
|
||||
This is an example admin page with a different menu bar that includes admin-specific options.
|
||||
</p>
|
||||
|
||||
<section style="margin-top: 1.5rem;">
|
||||
<h2 class="tui-text-yellow">System Status</h2>
|
||||
<div class="tui-panel">
|
||||
<p><strong>Server:</strong> Running</p>
|
||||
<p><strong>Users:</strong> 42 active</p>
|
||||
<p><strong>Uptime:</strong> 7 days, 3 hours</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section style="margin-top: 1.5rem;">
|
||||
<h2 class="tui-text-yellow">Quick Actions</h2>
|
||||
<button class="tui-button">View Logs</button>
|
||||
<button class="tui-button">Manage Users</button>
|
||||
<button class="tui-button">Settings</button>
|
||||
</section>
|
||||
</fieldset>
|
||||
{{end}}
|
||||
45
web/templates/index.html
Executable file
45
web/templates/index.html
Executable file
@@ -0,0 +1,45 @@
|
||||
{{template "layout" .}}
|
||||
|
||||
{{define "title"}}Estus Shots · Go + HTMX demo{{end}}
|
||||
|
||||
{{define "content"}}
|
||||
<fieldset class="tui-fieldset" style="padding: 2rem;">
|
||||
<legend>Estus Shots control panel</legend>
|
||||
<p class="tui-text-white">
|
||||
Estus Shots demonstrates a Go backend compiled into a single binary. The UI
|
||||
uses <strong>TUI.CSS</strong> for a retro feel and <strong>HTMX</strong> for
|
||||
partial page updates without JavaScript glue code.
|
||||
</p>
|
||||
|
||||
<section style="margin-top: 1.5rem;">
|
||||
<h2 class="tui-text-green">Interactive counter</h2>
|
||||
<p class="tui-text-silver">
|
||||
Click the button to trigger an <code>hx-post</code> request. The response
|
||||
replaces only the counter panel.
|
||||
</p>
|
||||
<div
|
||||
id="counter"
|
||||
hx-get="/counter"
|
||||
hx-trigger="load"
|
||||
hx-swap="outerHTML"
|
||||
>
|
||||
<div class="tui-panel tui-panel-inline">Loading…</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section style="margin-top: 1.5rem;">
|
||||
<h2 class="tui-text-green">Server time</h2>
|
||||
<p class="tui-text-silver">
|
||||
A periodic <code>hx-get</code> refresh keeps this panel in sync with the
|
||||
server clock.
|
||||
</p>
|
||||
<div
|
||||
id="server-time"
|
||||
hx-get="/time"
|
||||
hx-trigger="load, every 5s"
|
||||
>
|
||||
<div class="tui-panel tui-panel-inline">Loading…</div>
|
||||
</div>
|
||||
</section>
|
||||
</fieldset>
|
||||
{{end}}
|
||||
19
web/templates/layout.html
Normal file
19
web/templates/layout.html
Normal file
@@ -0,0 +1,19 @@
|
||||
{{define "layout"}}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>{{block "title" .}}Estus Shots{{end}}</title>
|
||||
<link rel="stylesheet" href="/static/lib/tuicss/tuicss.min.css" />
|
||||
<script src="/static/lib/htmx.2.0.7.min.js" defer></script>
|
||||
<script src="/static/lib/tuicss/tuicss.min.js" defer></script>
|
||||
</head>
|
||||
<body class="tui-bg-black">
|
||||
{{block "menubar" .}}{{end}}
|
||||
<main class="tui-container tui-window" style="margin-top: 2rem;">
|
||||
{{block "content" .}}{{end}}
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
{{end}}
|
||||
25
web/templates/menubar.html
Normal file
25
web/templates/menubar.html
Normal file
@@ -0,0 +1,25 @@
|
||||
{{define "menubar"}}
|
||||
<nav class="tui-nav">
|
||||
<ul>
|
||||
{{range .MenuGroups}}
|
||||
<li class="tui-dropdown">
|
||||
<span class="red-168-text">{{slice .Label 0 1}}</span>{{slice .Label 1}}
|
||||
<div class="tui-dropdown-content">
|
||||
<ul>
|
||||
{{range .Items}}
|
||||
{{if .IsDivider}}
|
||||
<li class="tui-divider"></li>
|
||||
{{else}}
|
||||
<li><a href="{{.URL}}"><span class="red-168-text">{{slice .Label 0 1}}</span>{{slice .Label 1}}</a></li>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
{{if .ShowClock}}
|
||||
<span class="tui-datetime" data-format="h:m:s a"></span>
|
||||
{{end}}
|
||||
</nav>
|
||||
{{end}}
|
||||
Reference in New Issue
Block a user