ident
All repositories: gitoria
3.0 KB
// components/identity.hl — `/identity/<id>`: ONE IDENTITY'S PAGE (ident#26), reached from "Used in" on the identities list.// Name, short id and "Used in": one row per app the identity is connected to — app name, "since <day> · last use <ago>" and// a "Notif." chip to the per-app page (`/inbox/<connection id>`, components/appsettings.hl). No identity edit here// (that stays on `/`). Layout after the ident#27 proposal 027-06 (the identity page); nothing of #27 is built.//// Faces: none — the page is read only.parent './main.hl'import { accountOfSession } from '../lib/accounts.hl'import { usedIn } from '../lib/usedin.hl'import { siteName } from '../project.hl'import { leadLook, messageLook, wideLook, avatarLook, chipLook } from './styles.hl'session = nulliid = nullme = accountOfSession(&session)signedIn = me != nullsignedOut = me == nullpage = me != null && iid != null ? usedIn(me.id, iid) : nullfound = page != nullnotFound = me != null && page == nullmeEmail = me != null ? me.email : ''who = page != null ? page.identity : nullrows = page != null ? page.rows : []hasRows = rows.length > 0noRows = rows.length == 0__title = siteName + (page != null ? ' | ' + page.identity.label : ' | identity')Style {pLead = leadLookpWide = wideLookpAvatar = avatarLookpChip = chipLookpMessage = messageLookidentityHead {display = 'flex'alignItems = 'center'gap = '.8rem'img {width = '48px'height = '48px'}}'#backtoids' {display = 'inline-flex'alignItems = 'center'minHeight = 'var(--layout-tap)'justifySelf = 'start'fontSize = '.875rem'}usedMain {flex = '1 1 10rem'display = 'grid'gap = '.15rem'minWidth = '0'}usedApp {fontWeight = '700'color = 'var(--color-text-strong)'overflowWrap = 'anywhere'}usedLine {color = 'var(--color-text-muted)'fontSize = '.875rem'overflowWrap = 'anywhere'}'#usedinsection' {marginTop = '.6rem'}}View {identCard { Style.pWideif (signedOut) {h1 { "Identity" }p { id = "signinfirst" Style.pLead "Sign in to ident first: " a { href = "/" "sign in" } "." }}if (notFound) {h1 { "Identity" }p { id = "notfound" Style.pMessage "This identity does not exist or is not yours." }p { class = "links" a { href = "/" "Back to your identities" } }}if (found) {a { id = "backtoids" href = "/" "‹ Identities" }identityHead {if (who.hasAvatar) { img { Style.pAvatar src = who.avatar alt = "" width = "48" height = "48" } }identityMain {h1 { id = "idlabel" who.label }identityShortId { id = "idshort" who.shortId }}}section { id = "usedinsection"h2 { "Used in" }if (noRows) { p { id = "usedinnone" Style.pLead "Not used in any app yet. When this identity signs in to an app, the app shows up here." } }ul { id = "usedin"for (u of rows) {li {usedMain {usedApp { u.app }usedLine { u.line }}a { Style.pChip href = u.href "Notif." }}}}}}}}
Branches
Latest commits
- 0f6d1592Merge branch 'f18b-shell-session' into mainIdent
- 19868218|||PR ident#39 shell reads its session member instead of a cross-file emitmre
- 5d1b3fedMerge branch 'v61-day61' into mainIdent
- 83faeb15|||PR ident: vendor Hybriel day61mre
- b2572b34Merge branch 'v59-day59' into mainIdent
- 67cf016d|||PR ident: vendor Hybriel day59mre
- 600c043dMerge branch 'v58-day58' into mainIdent
- 365f8c80|||PR ident: vendor Hybriel day58mre
- 585126e5Merge branch 'f16-setf' into mainIdent
- 953bf03a|||PR ident setF mirror dropped (hybriel#370)mre
- a1419d9cMerge branch 'f15-navigate' into mainIdent
- 3b3e451f|||PR ident#36 navigate to the app instead of location.assignmre
- e36f4516Merge branch 'f14-online' into mainIdent
- 2c5eac91|||PR ident#38 online state without probe timermre
- bf1980f2Merge branch 'v56-day56' into mainIdent
- 62ae0adf|||PR ident: vendor Hybriel day56mre
- 0d18abc4Merge branch 'f13-avatar' into mainIdent
- 2a99730a|||PR ident#37 avatar in hlmre
- fa4ed25bMerge branch 'f11-upsert' into mainIdent
- 8f3d9bc9|||PR ident#42 keyed upsert and removemre