gitoria

ident

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit1cf79e7e1cf79e7eident#34: the wide page column is a static in styles.hl (Style.pWide), not the class "wide"mre1cf79e7e/components/identity.hl

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

Branches

Latest commits

  • 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
  • 00235f21ident#33: the per-app notification switches move into appsettings.hl's Stylemre