tracker
All repositories: gitoria
1.6 KB
// components/home.hl — `/`: STEP 1, the empty homepage (tracker.worldapi.org#1).// Signed out: a link to ident's login button flow (`/login`, project.hl). Signed in: the// identity's public short id (ident hands nothing else to an app yet — properties handover// is ident#11, on hold) and a sign-out button. Nothing else: no shows, no data (CONCEPT.md,// tracker.worldapi.org#1 "Nothing else").parent './main.hl'session = nullme = session != null ? session.user : nullsignedIn = me != nullsignedOut = !signedInidentity = signedIn ? me.identity : ''__title = 'tracker' + (signedIn ? ' | ' + identity : ' | sign in')View {homeCard {if (signedOut) {h1 { "tracker" }p { "Sign in to see your homepage." }a { id = "signin" class = "button" href = "/login" "Sign in with ident" }}if (signedIn) {accountBar {userName { id = "identity" "Signed in as " identity }button { id = "signout" type = "button" class = "quiet" "Sign out" on click(e) { emit doSignOut(e) } }}h1 { "tracker" }p { id = "empty" "Nothing here yet." }}}}// the click emits a CLIENT handler, which calls the server face and then flips this// page's own reactive members — a member's INITIAL value is a computed expression, but// once mounted it is plain reactive state a handler can overwrite (ident's own doSignOut// does the same: components/home.hl, `emit server signOut()` then `signedIn = false` …).on doSignOut(e) {emit server signOut()signedIn = falsesignedOut = trueidentity = ''}on server signOut(session) {if (session != null) { session.user = null }return {}}
Branches
- mainmain branch
Latest commits
- 3691e176tracker#1: empty tracker with the ident login (state of 2026-09-27)mre