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
- 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
- 675493b1ident#42: editing an identity upserts the one edited row (face editIdentity answers { identity, row }); a create or delete keeps the whole list because the rows' position-dependent parts (default, Delete, Identity n) changemre
- 45e55303ident#42: an app write patches one row: upsert on create, edit and new secret, one-argument remove on delete; the faces answer the changed app (or the deleted id), not the whole listmre
- 991641d4Merge branch 'f10-access' into mainIdent
- e56d8273|||PR ident#34 part 4: access and inbox fixed classesmre
- df7696dbident#34: tests: access ticks selector quoting fixmre
- 7215903eident#34: access: the unstyled classes all, app, tick, apptick, plus are dropped; the gate finds the app ticks by input[name=app]mre
- 69b0a0ceident#34: access: the pick buttons use Style.pickCard instead of class pickmre
- dc702419Merge branch 'f9-choose' into mainIdent
- 8caec771|||PR ident#34 restore .choose hookmre
- 0dbff960Merge branch 'f8-shared' into mainIdent
- d69665f6|||PR ident#34 part 3: shared look classes (wide, avatar, chip/used, conn, choose, who, inboxlink) moved to statics or droppedmre
- 3a64dc48ident#34: chipLook: radius as the same var() string (a bare token name in a static does not compile); selector gate selectormre