Replace Pico CSS with a custom Solis-style design system — warm amber
on cream, Outfit font, 260px sidebar (logged in) or sticky public
header (logged out), soft amber-tinted shadows, cubic-bezier spring
animations on toasts and modals.
- Add static/css/style.css with the full design token system
- Add base.html + content-block pattern; each page defines its own
{{define "content"}} and base.html provides the chrome
- pageData gains ActiveNav; adminPage(w, r, nav) sets it; handlers
pass the right value for every admin route
- Standalone pages (login, 404, embed) render without base.html
- Templates use Solis-style data-table, card, stats-bar, tag-pill,
alert, btn components
- Remove vendored Pico CSS (83KB) and the old style.css (12KB)
- Update AGENTS.md and CLAUDE.md to reflect the new design system
Bug fixes during the redesign:
- Preview dialog now only shows when [open] (UA default was being
overridden by display:flex)
- Preview dialog centered via explicit top/left/transform — the
browser's default margin:auto centering fights with display:flex
on <dialog>
- Add ?embed=1 route that renders paste content without base.html
chrome, so the admin paste preview iframe shows only the body
Tested: go build ./... clean, go vet ./... clean, binary boots.
52 lines
1.7 KiB
HTML
52 lines
1.7 KiB
HTML
{{define "title"}}Edit Link — Glimmer{{end}}
|
|
{{define "content"}}
|
|
|
|
<div class="page-header">
|
|
<div class="page-title">
|
|
<h1>Edit Link</h1>
|
|
<p>Update the slug or destination URL.</p>
|
|
</div>
|
|
<div class="page-actions">
|
|
<a href="/admin" class="btn btn-secondary">Back to list</a>
|
|
</div>
|
|
</div>
|
|
|
|
{{if .Error}}
|
|
<div class="alert alert-error">{{.Error}}</div>
|
|
{{end}}
|
|
|
|
{{with .Link}}
|
|
<div class="card" style="max-width: 640px;">
|
|
<form method="post" action="/admin/edit/{{.ID}}">
|
|
<input type="hidden" name="csrf_token" value="{{$.CSRFToken}}">
|
|
|
|
<div class="form-group">
|
|
<label for="slug" class="form-label">Slug</label>
|
|
<input type="text" id="slug" name="slug" value="{{.Slug}}" required pattern="[a-zA-Z0-9_-]+" title="Letters, numbers, hyphens, underscores only">
|
|
<small class="form-help">The short path users will visit: <code>/<span id="slug-preview">{{.Slug}}</span></code></small>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="url" class="form-label">Destination URL</label>
|
|
<input type="url" id="url" name="url" value="{{.URL}}" required>
|
|
</div>
|
|
|
|
<hr class="divider">
|
|
|
|
<div class="flex gap-1">
|
|
<button type="submit" class="btn btn-primary">Save changes</button>
|
|
<a href="/admin" class="btn btn-secondary">Cancel</a>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
<script>
|
|
document.getElementById('slug').addEventListener('input', function() {
|
|
document.getElementById('slug-preview').textContent = this.value || '...';
|
|
});
|
|
</script>
|
|
{{else}}
|
|
<div class="alert alert-error">Link not found.</div>
|
|
{{end}}
|
|
{{end}}
|