repos / git-pr

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

commit
a148079
parent
4cce4d5
author
Eric Bower
date
2024-06-17 14:08:34 -0400 EDT
fix: anchor links
2 files changed,  +4, -4
M web.go
M tmpl/pr-detail.html
+3, -3
 1@@ -17,7 +17,7 @@
 2     <div class="box">
 3       <h2 class="text-lg m-0 p-0">
 4         {{if .Review}}<code>REVIEW</code>{{end}}
 5-        <a href="{{.Url}}">{{.Title}}</a>
 6+        <a href="#{{.Url}}">{{.Title}}</a>
 7       </h2>
 8       <div class="group-h text-sm">
 9         <code>{{.AuthorName}} &lt;{{.AuthorEmail}}&gt;</code>
10@@ -35,11 +35,11 @@
11 
12   <div class="group">
13     {{range .Patches}}
14-    <div class="box">
15+    <div class="box" id="{{.Url}}">
16       <div class="group-h">
17         <h2 class="text-lg m-0 p-0">
18           {{if .Review}}<code>REVIEW</code>{{end}}
19-          <a href="{{.Url}}">{{.Title}}</a>
20+          <a href="#{{.Url}}">{{.Title}}</a>
21         </h2>
22       </div>
23       <div>{{.DiffStr}}</div>
M web.go
+1, -1
1@@ -270,7 +270,7 @@ func prDetailHandler(w http.ResponseWriter, r *http.Request) {
2 
3 		patchesData = append(patchesData, PatchData{
4 			Patch:   patch,
5-			Url:     template.URL(fmt.Sprintf("#patch-%d", patch.ID)),
6+			Url:     template.URL(fmt.Sprintf("patch-%d", patch.ID)),
7 			DiffStr: template.HTML(diffStr),
8 		})
9 	}