gitoria

ident

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Main branchmain0f6d1592Merge branch 'f18b-shell-session' into mainIdentmain/components/identity.hl

3.0 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, chipLook } 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. pChip = chipLook
  31. pMessage = messageLook
  32. identityHead {
  33. display = 'flex'
  34. alignItems = 'center'
  35. gap = '.8rem'
  36. img {
  37. width = '48px'
  38. height = '48px'
  39. }
  40. }
  41. '#backtoids' {
  42. display = 'inline-flex'
  43. alignItems = 'center'
  44. minHeight = 'var(--layout-tap)'
  45. justifySelf = 'start'
  46. fontSize = '.875rem'
  47. }
  48. usedMain {
  49. flex = '1 1 10rem'
  50. display = 'grid'
  51. gap = '.15rem'
  52. minWidth = '0'
  53. }
  54. usedApp {
  55. fontWeight = '700'
  56. color = 'var(--color-text-strong)'
  57. overflowWrap = 'anywhere'
  58. }
  59. usedLine {
  60. color = 'var(--color-text-muted)'
  61. fontSize = '.875rem'
  62. overflowWrap = 'anywhere'
  63. }
  64. '#usedinsection' {
  65. marginTop = '.6rem'
  66. }
  67. }
  68. View {
  69. identCard { Style.pWide
  70. if (signedOut) {
  71. h1 { "Identity" }
  72. p { id = "signinfirst" Style.pLead "Sign in to ident first: " a { href = "/" "sign in" } "." }
  73. }
  74. if (notFound) {
  75. h1 { "Identity" }
  76. p { id = "notfound" Style.pMessage "This identity does not exist or is not yours." }
  77. p { class = "links" a { href = "/" "Back to your identities" } }
  78. }
  79. if (found) {
  80. a { id = "backtoids" href = "/" "‹ Identities" }
  81. identityHead {
  82. if (who.hasAvatar) { img { Style.pAvatar src = who.avatar alt = "" width = "48" height = "48" } }
  83. identityMain {
  84. h1 { id = "idlabel" who.label }
  85. identityShortId { id = "idshort" who.shortId }
  86. }
  87. }
  88. section { id = "usedinsection"
  89. h2 { "Used in" }
  90. 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." } }
  91. ul { id = "usedin"
  92. for (u of rows) {
  93. li {
  94. usedMain {
  95. usedApp { u.app }
  96. usedLine { u.line }
  97. }
  98. a { Style.pChip href = u.href "Notif." }
  99. }
  100. }
  101. }
  102. }
  103. }
  104. }
  105. }

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