diff options
author | Runxi Yu <me@runxiyu.org> | 2025-02-11 20:50:17 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-02-11 20:50:17 +0800 |
commit | 7491c424a00f0824f1d45b33d3b3f55fb0a7c4d8 (patch) | |
tree | 7a97d02446ebe590b0ae06d6435be8e8297eba0b /templates/repo_commit.html.tmpl | |
parent | repo_index.html, style.css: CSS state machines (diff) | |
download | forge-7491c424a00f0824f1d45b33d3b3f55fb0a7c4d8.tar.gz forge-7491c424a00f0824f1d45b33d3b3f55fb0a7c4d8.tar.zst forge-7491c424a00f0824f1d45b33d3b3f55fb0a7c4d8.zip |
repo_commit: Show chunks
Diffstat (limited to 'templates/repo_commit.html.tmpl')
-rw-r--r-- | templates/repo_commit.html.tmpl | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/templates/repo_commit.html.tmpl b/templates/repo_commit.html.tmpl index c480c92..edc4bc3 100644 --- a/templates/repo_commit.html.tmpl +++ b/templates/repo_commit.html.tmpl @@ -42,9 +42,22 @@ </table> </div> <div class="padding-wrapper scroll"> - <pre>{{ .patch }}</pre> - <p> - </p> + {{ range .file_patches }} + <div class="file-patch"> + {{ .From.Path }} {{ .From.Mode }} → {{ .To.Path }} {{ .To.Mode }} + {{ range .Chunks }} + {{ if eq .Type 0 }} + <pre class="chunk chunk-unchanged">{{ .Content }}</pre> + {{ else if eq .Type 1 }} + <pre class="chunk chunk-addition">{{ .Content }}</pre> + {{ else if eq .Type 2 }} + <pre class="chunk chunk-deletion">{{ .Content }}</pre> + {{ else }} + <pre class="chunk chunk-unknown">{{ .Content }}</pre> + {{ end }} + {{ end }} + </div> + {{ end }} </div> <footer> {{ template "footer" . }} |