gitoria

ident

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commite56d8273e56d8273|||PR ident#34 part 4: access and inbox fixed classesmree56d8273/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

  • 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
  • eb039073ident#34: tests: signin and migration find the choice without the classmre
  • 4b94a594ident#34: tests: fix selector of the identity choicemre
  • bebc88e4ident#34: main.hl drops the unstyled classes inboxlink and whomre
  • b4e7ad04ident#34: the identity choice link/button has no class (rule on #chooselist a)mre
  • 3c33d6eaident#34: the connection link in inbox has no class (rule on #conns a)mre
  • dc97ec0dident#34: the Notif. chip and the Used in link share chipLook (Style.pChip) instead of the classes chip/used/notifmre
  • 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