gitoria

tickets

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit239436d8239436d8Merge remote-tracking branch 'origin/main' into l33-finalmre239436d8/theme/shell/main-menu.hl

3.2 KB

  1. // main-menu.hl — THE MAIN MENU: the app's top-level links, `Series | Shows | Movies` (docs/layouts/main-menu.md).
  2. // Write it twice from ONE list: in the header (shown from 60rem) and in the sidebar (shown on the phone, where the
  3. // header has no room). The link whose href is `current` (or a page below it) is marked: class `current` and
  4. // aria-current="page". With no `current` given, the menu takes the page from the route (hybriel#197: `route = null`,
  5. // {path, params, pattern}, there in the server's HTML, so the marker is in the first paint and moves on a client click).
  6. // Without a matching path the host says which one: `current = "/docs"` (the page /read/x is
  7. // under Docs) or `current = true` on the item itself. An item may carry a small count: `count = 3` (a badge, not text).
  8. //
  9. // static menu = [ { label = 'Series' href = '/series' } { label = 'Movies' href = '/movies' } ]
  10. // AppHeader { MainMenu { items = menu current = "/series" } }
  11. // Sidebar { desktop = "false" MainMenu { items = menu current = "/series" } }
  12. Hybrid items = []
  13. String current = ''
  14. String label = 'Main menu'
  15. route = null
  16. Hybrid rows = build(items, current, route)
  17. // one row per link: the current one (the page itself or a page below it) is marked
  18. build(list, say, r) {
  19. // the host's say (`current`) wins; without one the shell's route (hybriel#197, in the server's HTML too) is the page
  20. at = say != '' ? say : (r == null ? '' : r.path)
  21. out = []
  22. for (it of list) {
  23. let here = it.current == true || at == it.href || (it.href != '/' && at.startsWith(it.href + '/'))
  24. let n = it.count == null ? '' : '' + it.count
  25. out.push({ label = it.label href = it.href count = n has = n != '' cls = here ? 'current' : '' aria = here ? 'page' : 'false' })
  26. }
  27. return out
  28. }
  29. Style {
  30. mainMenu {
  31. display = 'block'
  32. a {
  33. display = 'flex'
  34. alignItems = 'center'
  35. minHeight = 'var(--layout-tap)'
  36. padding = '.55rem .75rem'
  37. fontWeight = '600'
  38. color = 'var(--color-text)'
  39. borderRadius = 'var(--radius-small)'
  40. hover {
  41. textDecoration = 'none'
  42. color = 'var(--color-text-strong)'
  43. background = 'var(--color-surface)'
  44. }
  45. 'span.count' {
  46. marginLeft = '.5rem'
  47. padding = '0 .45rem'
  48. minWidth = '1.4rem'
  49. textAlign = 'center'
  50. fontSize = '.8rem'
  51. fontWeight = '700'
  52. lineHeight = '1.4rem'
  53. color = 'var(--color-accent-text)'
  54. background = 'var(--color-accent)'
  55. borderRadius = 'var(--radius-small)'
  56. }
  57. }
  58. 'a.current' {
  59. color = 'var(--color-accent)'
  60. background = 'var(--color-surface)'
  61. }
  62. }
  63. 'application-header' {
  64. mainMenu {
  65. display = 'none'
  66. @media {
  67. minWidth = '60rem'
  68. display = 'block'
  69. marginLeft = 'auto'
  70. }
  71. nav {
  72. @media {
  73. minWidth = '60rem'
  74. display = 'flex'
  75. gap = '.15rem'
  76. }
  77. }
  78. }
  79. }
  80. 'app-sidebar' {
  81. mainMenu {
  82. marginBottom = '1rem'
  83. @media {
  84. minWidth = '60rem'
  85. display = 'none'
  86. }
  87. }
  88. }
  89. @media {
  90. minWidth = '60rem'
  91. 'application-header' {
  92. mainMenu {
  93. a {
  94. minHeight = '2.25rem'
  95. padding = '.45rem .7rem'
  96. }
  97. }
  98. }
  99. }
  100. }
  101. View {
  102. mainMenu {
  103. nav { 'aria-label' = label
  104. for (r of rows) { a { href = r.href class = r.cls 'aria-current' = r.aria r.label if (r.has) { span { class = 'count' r.count } } } }
  105. }
  106. }
  107. }

Branches

Latest commits

  • 239436d8Merge remote-tracking branch 'origin/main' into l33-finalmre
  • 5822cb3aMerge branch 'o34-clean' into mainTickets
  • 0870653c|||PR offline note from __hlOnline, no polling (tickets#41)mre
  • 14cf96b4Merge branch 'records-t36' into mainTickets
  • 07749fa1|||PR records: day72 + #40 mergedmre
  • ecd7e226|||PR Consolidate login and move handler logic into topic libraries (partial)mre
  • 6dea1c60Merge branch 'r35-day72' into mainTickets
  • 7bcfdc22|||PR drop worker edits to conductor recordsmre
  • 2617b6ee|||PR dialogs: host flag cleared on close, dialog gate (tickets#40)mre
  • 6e701371|||PR record partial day72 dialog validationmre
  • b9fb9a91|||PR bind ticket dialog visibility to member flagsmre
  • 0788e65f|||PR re-vendor Hybriel day72mre
  • e2a6bdcfMerge branch 'records-t35' into mainTickets
  • d8d54df1|||PR records: R35 day72 + #40mre
  • 8a7f475aMerge branch 'records-t33' into mainTickets
  • e685d0c2|||PR records: PROCEDURES merge callmre
  • b42aff2b|||PR records: GO 2026-11-23, workers L33 O34, PROCEDURES.mdmre
  • ed091d44Merge branch 'records' into mainTickets
  • 180c0cdb|||PR records: ticket move live (M32), hybriel#439mre
  • 497cae7bMerge branch 'm32-move' into mainTickets