#256: rename page URLs to match nav labels (/public, /saved)
This commit is contained in:
@@ -42,7 +42,7 @@ function redeem() {
|
||||
try { tok = sessionStorage.getItem('deletion_token_' + PASTE_ID) || ''; } catch(e) {}
|
||||
if (!tok) { alert('deletion token not available in this browser'); return; }
|
||||
fetch('/api/pastes/' + PASTE_ID + '/redeem', {method: 'DELETE', headers: {'Authorization': 'Bearer ' + tok}})
|
||||
.then(r => { if (r.ok) location.href = '/history'; else alert('delete failed'); });
|
||||
.then(r => { if (r.ok) location.href = '/public'; else alert('delete failed'); });
|
||||
}
|
||||
|
||||
// wiring (moved from inline handlers for CSP #139)
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
|
||||
{{define "topbar"}}
|
||||
<div class="topbar">
|
||||
<a class="logo" href="/history">Palette <em>/ {{ version }}</em></a>
|
||||
<a class="logo" href="/public">Palette <em>/ {{ version }}</em></a>
|
||||
<nav>
|
||||
<a href="/new" {{if eq .Page "new"}}class="on"{{end}}>New</a>
|
||||
<a href="/history" {{if eq .Page "history"}}class="on"{{end}}>Public</a>
|
||||
<a href="/mine" {{if eq .Page "mine"}}class="on"{{end}}>Saved</a>
|
||||
<a href="/public" {{if eq .Page "public"}}class="on"{{end}}>Public</a>
|
||||
<a href="/saved" {{if eq .Page "saved"}}class="on"{{end}}>Saved</a>
|
||||
<a href="https://git.archfox.org/poslop/palette" target="_blank" rel="noopener">Git<svg class="ext" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/><polyline points="15 3 21 3 21 9"/><line x1="10" y1="14" x2="21" y2="3"/></svg></a>
|
||||
</nav>
|
||||
<div class="spacer"></div>
|
||||
|
||||
+4
-4
@@ -433,9 +433,9 @@ func (h *Handlers) HandleNewPage(w http.ResponseWriter, r *http.Request) {
|
||||
h.renderPage(w, "new.html", map[string]any{"Page": "new"})
|
||||
}
|
||||
|
||||
// HandleHistoryPage serves /history.
|
||||
// HandleHistoryPage serves /public.
|
||||
func (h *Handlers) HandleHistoryPage(w http.ResponseWriter, r *http.Request) {
|
||||
h.renderPage(w, "history.html", map[string]any{"Page": "history"})
|
||||
h.renderPage(w, "history.html", map[string]any{"Page": "public"})
|
||||
}
|
||||
|
||||
// HandleSettingsPage serves /settings.
|
||||
@@ -452,9 +452,9 @@ func (h *Handlers) HandleSettingsPage(w http.ResponseWriter, r *http.Request) {
|
||||
h.renderPage(w, "settings.html", map[string]any{"Page": "settings", "Themes": themes})
|
||||
}
|
||||
|
||||
// HandleMinePage serves /mine.
|
||||
// HandleMinePage serves /saved.
|
||||
func (h *Handlers) HandleMinePage(w http.ResponseWriter, r *http.Request) {
|
||||
h.renderPage(w, "mine.html", map[string]any{"Page": "mine"})
|
||||
h.renderPage(w, "mine.html", map[string]any{"Page": "saved"})
|
||||
}
|
||||
|
||||
// HandleAdminPage serves /admin.
|
||||
|
||||
Reference in New Issue
Block a user