gitoria

gitoria

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Branchf2-api-bugs26117255|||PR apps API: review comments on files with spaces in their namemref2-api-bugs/components/releases.hl

3.0 KB

  1. // components/releases.hl — THE RELEASES of a repo (gitoria#12, gitoria#16): `/releases` on <slug>.<domain>, its
  2. // own route. The repo head is rendered on the server from the request's host. The list comes from git (the
  3. // |||RL commits of the main branch) on the SERVER too
  4. // (lib/releases.hl releasesNow — hl:proc run() waits, hybriel#80): it is in the first HTML and in every hl:web navigation.
  5. parent './repo.hl'
  6. import { siteName } from '../project.hl'
  7. import { slugOfRequest } from '../lib/orgs.hl'
  8. import { titleSlug, repoAt } from '../lib/repos.hl'
  9. import { pageTitle } from '../lib/repos-helpers.hl'
  10. import { releasesNow } from '../lib/releases.hl'
  11. host = null
  12. orepo = ''
  13. session = null
  14. slug = slugOfRequest(host, orepo)
  15. repo = repoAt(slug, session)
  16. hasRepo = repo != null
  17. got = repo != null ? releasesNow(slug, repo.branch) : null
  18. releasesShown = got != null && !got.isMessage
  19. releasesMessage = got != null && got.isMessage
  20. releasesText = got != null && got.isMessage ? got.message : ''
  21. releasesNone = got != null && !got.isMessage && got.noReleases
  22. releasesList = got != null && !got.isMessage ? got.releases : []
  23. releasesDefault = got != null && !got.isMessage ? got.defaultName : ''
  24. __title = pageTitle(siteName, titleSlug(host, orepo, session), 'Releases')
  25. View {
  26. repoPage {
  27. if (hasRepo) {
  28. repoReleases { id = "releases"
  29. if (releasesMessage) { p { id = "releasesmessage" class = "empty" releasesText } }
  30. if (releasesShown) {
  31. p { id = "releaseshelp" class = "muted" "A commit on " strong { releasesDefault } " whose message starts with " code { "|||RL " } " makes a release: the last version +1; " code { "|||RL|med " } " counts the middle number, " code { "|||RL|mj " } " the major number, " code { "|||RL|1.1.1a " } " sets the version." }
  32. if (releasesNone) { p { id = "noreleases" class = "empty" "No release yet." } }
  33. ol { id = "releaselist"
  34. for (rl of releasesList) {
  35. li {
  36. strong { Style.strongVersion rl.version }
  37. if (rl.isLatest) { span { Style.spanLatest "latest" } }
  38. if (rl.hasTitle) { a { Style.aReleaseSubject href = rl.href rl.title } }
  39. if (rl.noTitle) { a { Style.aReleaseSubject class = "muted" href = rl.href rl.short } }
  40. span { class = "muted" rl.author }
  41. time { rl.date }
  42. }
  43. }
  44. }
  45. }
  46. }
  47. }
  48. }
  49. }
  50. Style {
  51. repoReleases {
  52. display = 'grid'
  53. gap = '1rem'
  54. minWidth = '0'
  55. // Direct-child universal selectors have no bare language form.
  56. '> *' {
  57. margin = '0'
  58. }
  59. }
  60. #releaselist {
  61. display = 'grid'
  62. gap = '.4rem'
  63. margin = '0'
  64. padding = '0'
  65. listStyle = 'none'
  66. li {
  67. display = 'flex'
  68. flexWrap = 'wrap'
  69. alignItems = 'center'
  70. gap = '0 .8rem'
  71. margin = '0'
  72. padding = '.1rem 1rem .3rem'
  73. background = 'var(--color-surface)'
  74. borderRadius = 'var(--radius-large)'
  75. overflowWrap = 'anywhere'
  76. }
  77. }
  78. strongVersion {
  79. fontSize = '1.05rem'
  80. color = 'var(--color-accent)'
  81. }
  82. spanLatest {
  83. fontSize = '.875rem'
  84. color = 'var(--color-text-muted)'
  85. }
  86. aReleaseSubject {
  87. flex = '1 1 12rem'
  88. display = 'inline-flex'
  89. alignItems = 'center'
  90. minHeight = '2.75rem'
  91. }
  92. }

Branches

Latest commits

  • 26117255|||PR apps API: review comments on files with spaces in their namemre
  • b8796cecMerge branch 'f1-broken-json' into mainGitoria
  • 2f2959c5|||PR apps API: broken JSON body gives 400 invalid_json, not 500mre
  • f7c6ca07Merge branch 'ident-chooser-selector' into mainGitoria
  • 691abb8e|||PR tests: find ident identity choice without the removed .choose classmre
  • 16a3530fMerge branch 'heap-revert' into mainGitoria
  • 220a80e0|||PR Remove temporary /__heap route and heap helper; logmre
  • 13f0c342Merge branch 'hl25-records' into mainGitoria
  • a002ecb7|||PR records: HL25 report, heap helper, logmre
  • 2492a55cTemporary keyed /__heap route for the live memory snapshotmre
  • fefaedd2log: tracker PR-only, HL25 startedmre
  • 21aa57calog: parkmre
  • e9f950a8reports: G25c soakmre
  • a7783686log: deploy 9f41ffcmre
  • 9f41ffc1log: W30b mergedmre
  • bef635c1Merge branch 'w30b'mre
  • 15b996a5Org list: keyed rows by @id, newest first, concat instead of hand loopmre
  • c4f6d9e3reports: G25c growth huntmre
  • b88e39f1log: privacy cleanup donemre
  • bfd7826ddocs: neutral example organisation namemre