gitoria

gitoria

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commited3b922bed3b922b|||PR move a repository into an organization in Settings (#53)mreed3b922b/components/releases.hl

3.2 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. titleRepo = repoAt(slugOfRequest(host, orepo), session)
  25. __title = pageTitle(siteName, titleSlug(host, orepo, session), 'Releases')
  26. View {
  27. repoPage {
  28. if (hasRepo) {
  29. repoReleases { id = "releases"
  30. if (releasesMessage) { p { id = "releasesmessage" class = "empty" releasesText } }
  31. if (releasesShown) {
  32. 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." }
  33. if (releasesNone) { p { id = "noreleases" class = "empty" "No release yet." } }
  34. ol { id = "releaselist"
  35. for (rl of releasesList) {
  36. li {
  37. strong { Style.strongVersion rl.version }
  38. if (rl.isLatest) { span { Style.spanLatest "latest" } }
  39. if (rl.hasTitle) { a { Style.aReleaseSubject href = rl.href rl.title } }
  40. if (rl.noTitle) { a { Style.aReleaseSubject class = "muted" href = rl.href rl.short } }
  41. span { class = "muted" rl.author }
  42. time { rl.date }
  43. }
  44. }
  45. }
  46. }
  47. }
  48. }
  49. }
  50. }
  51. Style {
  52. repoReleases {
  53. display = 'grid'
  54. gap = '1rem'
  55. minWidth = '0'
  56. // Direct-child universal selectors have no bare language form.
  57. '> *' {
  58. margin = '0'
  59. }
  60. }
  61. #releaselist {
  62. display = 'grid'
  63. gap = '.4rem'
  64. margin = '0'
  65. padding = '0'
  66. listStyle = 'none'
  67. li {
  68. display = 'flex'
  69. flexWrap = 'wrap'
  70. alignItems = 'center'
  71. gap = '0 .8rem'
  72. margin = '0'
  73. padding = '.1rem 1rem .3rem'
  74. background = 'var(--color-surface)'
  75. borderRadius = 'var(--radius-large)'
  76. overflowWrap = 'anywhere'
  77. }
  78. }
  79. strongVersion {
  80. fontSize = '1.05rem'
  81. color = 'var(--color-accent)'
  82. }
  83. spanLatest {
  84. fontSize = '.875rem'
  85. color = 'var(--color-text-muted)'
  86. }
  87. aReleaseSubject {
  88. flex = '1 1 12rem'
  89. display = 'inline-flex'
  90. alignItems = 'center'
  91. minHeight = '2.75rem'
  92. }
  93. }
  94. on client repoChanged(Hybrid row) {
  95. if (titleRepo != null && row.id == titleRepo.id) { __title = pageTitle(siteName, row.heading, 'Releases') }
  96. }

Branches

Latest commits

  • ed3b922b|||PR move a repository into an organization in Settings (#53)mre
  • 74ec2af8Merge branch 'w54-repo-rename-pr' into mainGitoria
  • 9f7ce8d8Preserve rename compatibility and live page titlesmre
  • c3d95b6e|||PR separate names and addresses, rename repositories in Settings (#53)mre
  • ce08920dMerge branch 'w52c-header-phone' into mainGitoria
  • 0bab9e46|||PR header: ident status wraps on phones instead of clippingmre
  • e7af3eceMerge branch 'w52b-approval-followup' into mainGitoria
  • c01e66c6|||PR approvals follow-up: live Merge after status writes, helpers (#52)mre
  • 841da497Merge branch 'w53-pulls-speed-pr' into mainGitoria
  • 80307ae2|||PR pulls page cache: live PR numbers, complete scans onlymre
  • 69141f65|||PR pulls page: cache the git part per repo by branch tipsmre
  • 155861f6Merge branch 'w52-person-approval' into mainGitoria
  • b5435de8|||PR person approvals: second Kunibert round (#52)mre
  • 3a8b2fb8|||PR person approvals: Kunibert review fixes (#52)mre
  • 2a89d8d0|||PR person approvals: Approve button for people; merge needs the required checks or a listed person's approval (#52)mre
  • 83f0c953Report person approval verificationmre
  • 3ae94b86Record browser failures and verify owned tab cleanupmre
  • 54eec687Gate person approvals and merge alternativesmre
  • 12b08829Add person approvals for pull request headsmre
  • 55c84779Merge branch 'gp-gate-ports' into mainGitoria