repos / git-pr

a self-hosted git collaboration server
git clone https://github.com/picosh/git-pr.git

commit
c37e04e
parent
3eb94cf
author
Eric Bower
date
2024-12-23 16:23:04 -0500 EST
refactor(web): default status is open

This changes the default patch request index view to show only patch
requests with status `open`.  This helps with the noise.
2 files changed,  +4, -3
M web.go
M tmpl/index.html
+1, -3
 1@@ -218,9 +218,7 @@ git push origin main
 2 <main>
 3   <div>
 4     filter
 5-    <a href="/">all</a>
 6-    &middot;
 7-    <a href="/?status=open">open</a>
 8+    <a href="/">open</a>
 9     &middot;
10     <a href="/?status=reviewed">reviewed</a>
11     &middot;
M web.go
+3, -0
 1@@ -159,6 +159,9 @@ func createPrDataSorter(sort, sortDir string) func(a, b *PrListData) int {
 2 func getPrTableData(web *WebCtx, prs []*PatchRequest, query url.Values) ([]*PrListData, error) {
 3 	prdata := []*PrListData{}
 4 	status := strings.ToLower(query.Get("status"))
 5+	if status == "" {
 6+		status = "open"
 7+	}
 8 	username := strings.ToLower(query.Get("user"))
 9 	title := strings.ToLower(query.Get("title"))
10 	sort := strings.ToLower(query.Get("sort"))