gitoria

ident

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit378bd432378bd432ident#34: the identity picture look is a static in styles.hl (Style.pAvatar); sizes stay with each listmre378bd432/components/identity.hl

3.4 KB

  1. // components/identity.hl — `/identity/<id>`: ONE IDENTITY'S PAGE (ident#26), reached from "Used in" on the identities list.
  2. // Name, short id and "Used in": one row per app the identity is connected to — app name, "since <day> · last use <ago>" and
  3. // a "Notif." chip to the per-app page (`/inbox/<connection id>`, components/appsettings.hl). No identity edit here
  4. // (that stays on `/`). Layout after the ident#27 proposal 027-06 (the identity page); nothing of #27 is built.
  5. //
  6. // Faces: none — the page is read only.
  7. parent './main.hl'
  8. import { accountOfSession } from '../lib/accounts.hl'
  9. import { usedIn } from '../lib/usedin.hl'
  10. import { siteName } from '../project.hl'
  11. import { leadLook, messageLook, wideLook, avatarLook } from './styles.hl'
  12. session = null
  13. iid = null
  14. me = accountOfSession(&session)
  15. signedIn = me != null
  16. signedOut = me == null
  17. page = me != null && iid != null ? usedIn(me.id, iid) : null
  18. found = page != null
  19. notFound = me != null && page == null
  20. meEmail = me != null ? me.email : ''
  21. who = page != null ? page.identity : null
  22. rows = page != null ? page.rows : []
  23. hasRows = rows.length > 0
  24. noRows = rows.length == 0
  25. __title = siteName + (page != null ? ' | ' + page.identity.label : ' | identity')
  26. Style {
  27. pLead = leadLook
  28. pWide = wideLook
  29. pAvatar = avatarLook
  30. pMessage = messageLook
  31. identityHead {
  32. display = 'flex'
  33. alignItems = 'center'
  34. gap = '.8rem'
  35. img {
  36. width = '48px'
  37. height = '48px'
  38. }
  39. }
  40. '#backtoids' {
  41. display = 'inline-flex'
  42. alignItems = 'center'
  43. minHeight = 'var(--layout-tap)'
  44. justifySelf = 'start'
  45. fontSize = '.875rem'
  46. }
  47. usedMain {
  48. flex = '1 1 10rem'
  49. display = 'grid'
  50. gap = '.15rem'
  51. minWidth = '0'
  52. }
  53. usedApp {
  54. fontWeight = '700'
  55. color = 'var(--color-text-strong)'
  56. overflowWrap = 'anywhere'
  57. }
  58. usedLine {
  59. color = 'var(--color-text-muted)'
  60. fontSize = '.875rem'
  61. overflowWrap = 'anywhere'
  62. }
  63. // the "Notif." chip, and the identities list's "Used in…" link (identitylist.hl) that looks the same
  64. 'a.chip, identity-actions a.used' {
  65. display = 'inline-flex'
  66. alignItems = 'center'
  67. justifyContent = 'center'
  68. minHeight = 'var(--layout-tap)'
  69. minWidth = 'var(--layout-tap)'
  70. padding = '0 .8rem'
  71. fontSize = '.875rem'
  72. background = 'var(--color-background-sunken)'
  73. borderRadius = 'var(--radius-small)'
  74. }
  75. '#usedinsection' {
  76. marginTop = '.6rem'
  77. }
  78. }
  79. View {
  80. identCard { Style.pWide
  81. if (signedOut) {
  82. h1 { "Identity" }
  83. p { id = "signinfirst" Style.pLead "Sign in to ident first: " a { href = "/" "sign in" } "." }
  84. }
  85. if (notFound) {
  86. h1 { "Identity" }
  87. p { id = "notfound" Style.pMessage "This identity does not exist or is not yours." }
  88. p { class = "links" a { href = "/" "Back to your identities" } }
  89. }
  90. if (found) {
  91. a { id = "backtoids" href = "/" "‹ Identities" }
  92. identityHead {
  93. if (who.hasAvatar) { img { Style.pAvatar src = who.avatar alt = "" width = "48" height = "48" } }
  94. identityMain {
  95. h1 { id = "idlabel" who.label }
  96. identityShortId { id = "idshort" who.shortId }
  97. }
  98. }
  99. section { id = "usedinsection"
  100. h2 { "Used in" }
  101. 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." } }
  102. ul { id = "usedin"
  103. for (u of rows) {
  104. li {
  105. usedMain {
  106. usedApp { u.app }
  107. usedLine { u.line }
  108. }
  109. a { class = "chip notif" href = u.href "Notif." }
  110. }
  111. }
  112. }
  113. }
  114. }
  115. }
  116. }

Branches

Latest commits

  • 378bd432ident#34: the identity picture look is a static in styles.hl (Style.pAvatar); sizes stay with each listmre
  • 1cf79e7eident#34: the wide page column is a static in styles.hl (Style.pWide), not the class "wide"mre
  • ddc7d135Merge branch 'f7-hooks' into mainIdent
  • eee0b513|||PR ident#34 part: test-hook classes replaced by name/element/attribute selectors (tests adjusted), the shared lead/message/notice looks are statics in styles.hlmre
  • ccd6d0c4ident#34: browser gate: rowButton finds the row's button by namemre
  • 24dd414eident#34: the shared lead, message and notice looks are statics in components/styles.hl, imported by the components (lib/looks.hl gone)mre
  • 03ed26c7ident#34: access.hl: the remaining lead classes droppedmre
  • 1d066c42ident#34: access.hl drops its unstyled lead class (the shared lead rule would otherwise mute it)mre
  • 1e1dd7b4ident#34: the access page keeps its lead class string (the page has no ident-card, so its lead line was never muted; a shared rule would change the look)mre
  • 89ac6553ident#34: the lead, message and notice lines are named with Style.pLead / pMessage / pNotice (shared bodies in lib/looks.hl) instead of class stringsmre
  • e84be3deident#34: browser gate lists the Edit/Delete buttons by namemre
  • fb7111faident#34: access page: unstyled test-hook classes (idrow, never, who, whoname, appname, neverrevoke) dropped; the tests use element/name selectorsmre
  • 9f2ad803ident#34: notification switches: push/email by name=..., locked by aria-disabled, the switch look is the role=switch button (no switch/push/email/locked classes)mre
  • e0f0ddaaident#34: inbox: the Mark read/unread button is styled as the button of its note-foot, the icon is found as the row's img (no toggle/icon classes)mre
  • 16b49756ident#34: unused row classes (choice, usedrow, kind, shortid) droppedmre
  • f9d6fb38ident#34: apps and identity rows: the Edit/New secret/Delete buttons carry name=..., the API key is found by its element; unused row classes (app, identity, shortid) droppedmre
  • b323265aMerge branch 'f5-styles' into mainIdent
  • 9ced53c3|||PR ident#33 ident#35 every component's styles live in its own Style block; styles.hl keeps the page-wide rest; the account bar is phone first (min-width: 60rem block); the avatar preview is hidden with the hidden attribute (ident#34 in part)mre
  • f28333e4ident#33 ident#35: styles.hl keeps only the accent, the page column and the shared patterns; the account bar is written phone first (base rule + one min-width: 60rem block) instead of a max-width overridemre
  • 5b4541fcident#33: the selector sign-in frame's rules move into embed.hl's Stylemre