vole
Clone
Read only, no credentials:
https://rodent.software/git/vole.git
Write over SSH with a registered key:
git clone ssh://git@0.0.0.0:2222/vole.git
A free and open-source forge that lives in your Git repo.
Lead an issue or change page with its number
de84c32b49652afb50e5b71d8bf842a4871ec7ec · Keenan Nemetz · 5d ago · parent eec0e603
Lead an issue or change page with its number The number alias sat in the subtitle while the heading showed the title alone, and the document title led with the repository, so a browser tab or a bookmark hid which item it was. Put the number before the title on both pages, and name the document from the item outwards: number and title, then the tab, then the repository.
server/web/request_view.go +11−8
| @@ -191,7 +191,7 @@ func (v requestSidebarView) withLanding(l requestLandingView) requestSidebarView | |||
| 191 | 191 | // replacement for the sidebar: a write can update the status regions without | |
| 192 | 192 | // loading or throwing away an issue search or a target picker. | |
| 193 | 193 | func (w *Web) requestLiveWrite(r *http.Request, m *repo.Meta, req *metadata.Request, errMsg string) requestSidebarView { | |
| 194 | v := w.requestStatus(r, m, req, "", errMsg).withLanding(w.requestLanding(m, req)) | ||
| 194 | v := w.requestStatus(r, m, req, errMsg).withLanding(w.requestLanding(m, req)) | ||
| 195 | 195 | v.Live = true | |
| 196 | 196 | return v | |
| 197 | 197 | } | |
| @@ -211,7 +211,7 @@ type requestPageView struct { | |||
| 211 | 211 | // which controls exist. It deliberately leaves out the stateful regions — the | |
| 212 | 212 | // branch picker, the linked-issue list, and the issue numbering — so a poll does | |
| 213 | 213 | // not load the data only an editor needs. | |
| 214 | func (w *Web) requestStatus(r *http.Request, m *repo.Meta, req *metadata.Request, title, errMsg string) requestSidebarView { | ||
| 214 | func (w *Web) requestStatus(r *http.Request, m *repo.Meta, req *metadata.Request, errMsg string) requestSidebarView { | ||
| 215 | 215 | acl, _ := m.ACL() | |
| 216 | 216 | approvals := make([]requestApproval, 0, len(req.Approvals)) | |
| 217 | 217 | current := 0 | |
| @@ -354,7 +354,7 @@ func (w *Web) requestStatus(r *http.Request, m *repo.Meta, req *metadata.Request | |||
| 354 | 354 | } | |
| 355 | 355 | } | |
| 356 | 356 | return requestSidebarView{ | |
| 357 | Page: w.page(r, title), Name: m.Name, Request: req, | ||
| 357 | Page: w.page(r, ""), Name: m.Name, Request: req, | ||
| 358 | 358 | Approvals: approvals, Checks: checks, Required: required, Current: current, | |
| 359 | 359 | CanApprove: approvable, CanClose: canClose, HeadRefNote: headRefNote, | |
| 360 | 360 | CanEditIssues: req.Open() && canClose, | |
| @@ -371,9 +371,11 @@ func (w *Web) requestStatus(r *http.Request, m *repo.Meta, req *metadata.Request | |||
| 371 | 371 | ||
| 372 | 372 | // requestSidebar adds the stateful regions to requestStatus: the branch picker's | |
| 373 | 373 | // options, the change number, and the linked-issue rows. Only a full page or a | |
| 374 | // write that belongs to one of those regions needs them. | ||
| 375 | func (w *Web) requestSidebar(r *http.Request, m *repo.Meta, req *metadata.Request, title, errMsg string) requestSidebarView { | ||
| 376 | v := w.requestStatus(r, m, req, title, errMsg) | ||
| 374 | // write that belongs to one of those regions needs them. The section names the | ||
| 375 | // tab the page is showing, and is empty for the conversation, so the document | ||
| 376 | // title leads with the change and then names where the reader is. | ||
| 377 | func (w *Web) requestSidebar(r *http.Request, m *repo.Meta, req *metadata.Request, section, errMsg string) requestSidebarView { | ||
| 378 | v := w.requestStatus(r, m, req, errMsg) | ||
| 377 | 379 | if v.CanRetarget { | |
| 378 | 380 | acl, _ := m.ACL() | |
| 379 | 381 | who := w.accountName(r) | |
| @@ -383,6 +385,7 @@ func (w *Web) requestSidebar(r *http.Request, m *repo.Meta, req *metadata.Reques | |||
| 383 | 385 | } | |
| 384 | 386 | nums := w.entityNumbers(memoOf(r), m) | |
| 385 | 387 | v.Number = nums[req.ID] | |
| 388 | v.Title = numberedTitle(v.Number, req.Title, section, m.Name) | ||
| 386 | 389 | v.LinkedIssues = w.requestLinkedIssues(memoOf(r), m, req, nums) | |
| 387 | 390 | return v | |
| 388 | 391 | } | |
| @@ -588,7 +591,7 @@ func (w *Web) RequestLive(rw http.ResponseWriter, r *http.Request) { | |||
| 588 | 591 | w.notFound(rw, r) | |
| 589 | 592 | return | |
| 590 | 593 | } | |
| 591 | view := w.requestStatus(r, m, req, "", "").withLanding(w.requestLanding(m, req)) | ||
| 594 | view := w.requestStatus(r, m, req, "").withLanding(w.requestLanding(m, req)) | ||
| 592 | 595 | view.Live = true | |
| 593 | 596 | w.render(rw, "request_live", view, 0) | |
| 594 | 597 | } | |
| @@ -640,7 +643,7 @@ func (w *Web) renderRequestPage(rw http.ResponseWriter, r *http.Request, errMsg | |||
| 640 | 643 | } | |
| 641 | 644 | ||
| 642 | 645 | comments := w.requestComments(m, req) | |
| 643 | sidebar := w.requestSidebar(r, m, req, m.Name+" · "+req.Title, errMsg). | ||
| 646 | sidebar := w.requestSidebar(r, m, req, "", errMsg). | ||
| 644 | 647 | withLanding(w.landingFrom(m, req, w.reviewDiff(m, req))) | |
| 645 | 648 | if r.URL.Query().Get("merging") == "1" { | |
| 646 | 649 | sidebar.Notice = "Merging when the combined result passes. Use Cancel merge to stop waiting." | |