OverviewFilesCommitsIssuesDocsReleasesPeers

hyper-booking commits / 609589d

Add Dashboard nav link on provider pages when signed in
Dashboard button appears in nav bar after sign-in, hidden for anonymous users. Consistent across provider landing and booking pages. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
609589deb7925006f4693416b4ca3908f676f2de
by plankatron <fleeky@gmail.com> · 2026-03-22T18:32:32.000Z

Changed files (3) +21 -2

lib/routes/web.js +8 -2
……@@ -76,7 +76,10 @@ export function registerPublicRoutes (router, server) {
7676 <div class="container">
7777 <nav class="nav-bar">
7878 <a href="${server.pathPrefix}/${esc(provider.slug)}" style="text-decoration:none;color:inherit;">&larr; ${esc(provider.displayName)}</a>
79 <button class="btn btn-secondary" id="sign-in-btn">Sign In</button>
79 <div class="nav-right">
80 <a href="${prefix}/dashboard" class="btn btn-secondary" id="dashboard-link" style="display:none">Dashboard</a>
81 <button class="btn btn-secondary" id="sign-in-btn">Sign In</button>
82 </div>
8083 </nav>
8184
8285 <section style="padding: 1rem 0;">
……@@ -205,7 +208,10 @@ function renderProviderPage (provider, packages, prefix) {
205208 <div class="container">
206209 <nav class="nav-bar">
207210 <span class="nav-logo">hyper-booking</span>
208 <button class="btn btn-secondary" id="sign-in-btn">Sign In</button>
211 <div class="nav-right">
212 <a href="${prefix}/dashboard" class="btn btn-secondary" id="dashboard-link" style="display:none">Dashboard</a>
213 <button class="btn btn-secondary" id="sign-in-btn">Sign In</button>
214 </div>
209215 </nav>
210216
211217 <section class="hero">
web/css/app.css +6 -0
……@@ -45,6 +45,12 @@ body {
4545 color: var(--text);
4646}
4747
48.nav-right {
49 display: flex;
50 align-items: center;
51 gap: 0.5rem;
52}
53
4854/* Buttons */
4955.btn {
5056 display: inline-block;
web/js/app.js +7 -0
……@@ -58,15 +58,22 @@ if (signInBtn) {
5858 await HyperBookingIdentity.generate()
5959 showToast('Identity created', 'success')
6060 signInBtn.textContent = 'Signed In'
61 showDashboardLink()
6162 }
6263 })
6364
6465 // Update button if already signed in
6566 if (typeof HyperBookingIdentity !== 'undefined' && HyperBookingIdentity.hasKeypair()) {
6667 signInBtn.textContent = 'Signed In'
68 showDashboardLink()
6769 }
6870}
6971
72function showDashboardLink () {
73 const link = document.getElementById('dashboard-link')
74 if (link) link.style.display = ''
75}
76
7077// ---- Booking Page ----
7178// When a booking page loads, this handles the calendar + slot selection
7279