repos / git-pr

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

commit
dcef9ea
parent
a036382
author
Eric Bower
date
2024-12-20 14:39:27 -0500 EST
fix: user repo owner id for repo links
3 files changed,  +32, -8
M web.go
M static/git-pr.css
+4, -0
 1@@ -74,6 +74,10 @@ details {
 2   padding: 0;
 3 }
 4 
 5+.chroma .gi {
 6+  font-weight: normal !important;
 7+}
 8+
 9 @media only screen and (max-width: 40em) {
10   .collapse {
11     flex-direction: column;
M static/smol.css
+19, -6
 1@@ -176,8 +176,7 @@ blockquote code {
 2   border: 1px solid var(--blockquote);
 3 }
 4 
 5-ul,
 6-ol {
 7+ul {
 8   padding: 0 0 0 var(--line-height);
 9   list-style-position: inside;
10   list-style-type: square;
11@@ -188,6 +187,16 @@ ul[style*="list-style-type: none;"] {
12   padding: 0;
13 }
14 
15+ol {
16+  padding: 0 0 0 var(--line-height);
17+  list-style-type: decimal;
18+  margin: var(--line-height) 0;
19+}
20+
21+ol[style*="list-style-type: none;"] {
22+  padding: 0;
23+}
24+
25 ol ul, ol ol, ul ol, ul ul {
26   padding: 0 0 0 3ch;
27   margin: 0;
28@@ -202,10 +211,6 @@ li::marker {
29   line-height: 0;
30 }
31 
32-li > pre {
33-  padding: 0;
34-}
35-
36 footer {
37   text-align: center;
38   margin-bottom: calc(var(--line-height) * 3);
39@@ -227,6 +232,10 @@ figure {
40   margin: 0;
41 }
42 
43+sup {
44+  line-height: 0;
45+}
46+
47 #toc {
48   margin-top: var(--line-height);
49 }
50@@ -371,6 +380,10 @@ figure {
51   flex-direction: column;
52 }
53 
54+.flex-wrap {
55+  flex-wrap: wrap;
56+}
57+
58 .items-center {
59   align-items: center;
60 }
M web.go
+9, -2
 1@@ -706,8 +706,15 @@ func createPrDetail(page string) http.HandlerFunc {
 2 			return
 3 		}
 4 
 5-		repoNs := web.Backend.CreateRepoNs(user.Name, repo.Name)
 6-		url := fmt.Sprintf("/r/%s/%s", user.Name, repo.Name)
 7+		repoOwner, err := web.Pr.GetUserByID(repo.UserID)
 8+		if err != nil {
 9+			web.Logger.Error("cannot get repo for pr", "err", err)
10+			w.WriteHeader(http.StatusUnprocessableEntity)
11+			return
12+		}
13+
14+		repoNs := web.Backend.CreateRepoNs(repoOwner.Name, repo.Name)
15+		url := fmt.Sprintf("/r/%s/%s", repoOwner.Name, repo.Name)
16 		err = tmpl.Execute(w, PrDetailData{
17 			Page: "pr",
18 			Repo: LinkData{