From b4cb2c5a4a603191e12c9d6afb4688c730ce1fbe Mon Sep 17 00:00:00 2001 From: Anirudh Oppiliappan Date: Wed, 26 Feb 2025 01:18:57 +0200 Subject: [PATCH] fix bug with commit page --- appview/pages/templates/repo/commit.html | 76 +++++++++++++----------- 1 file changed, 40 insertions(+), 36 deletions(-) diff --git a/appview/pages/templates/repo/commit.html b/appview/pages/templates/repo/commit.html index 94fdf27..fd5f7f3 100644 --- a/appview/pages/templates/repo/commit.html +++ b/appview/pages/templates/repo/commit.html @@ -39,18 +39,19 @@

- Affected files + Affected files {{ range $diff }} + {{ end }}
-{{end}} + {{end}} {{ define "repoAfter" }} @@ -83,11 +84,11 @@ M {{ end }} - {{ $name := .Name.New}} {{ if .IsDelete }} - {{ $name = .Name.Old }} + {{ .Name.Old }} + {{ else }} + {{ .Name.New }} {{ end }} - {{ $name }} {{ $iconstyle := "p-1 mx-1 hover:bg-gray-100 rounded" }} @@ -106,35 +107,38 @@ - - - {{ if .IsDelete }} -

This file as been deleted.

- {{ else }} - {{ if .IsBinary }} -

Not showing binary file.

- {{ else }} -
-                {{- range .TextFragments -}}
-                
{{ .Header }}
- {{- range .Lines -}} - {{- if eq .Op.String "+" -}} -
{{ .Op.String }}{{ .Line }}
- {{- end -}} - - {{- if eq .Op.String "-" -}} -
{{ .Op.String }}{{ .Line }}
- {{- end -}} - - {{- if eq .Op.String " " -}} -
{{ .Op.String }}{{ .Line }}
- {{- end -}} - - {{- end -}} - {{- end -}} -
+ + {{ if .IsDelete }} +

+ This file has been deleted in this commit. +

+ {{ else }} + {{ if .IsBinary }} +

+ This is a binary file and will not be displayed. +

+ {{ else }} +
+            {{- range .TextFragments -}}
+              
{{ .Header }}
+ {{- range .Lines -}} + {{- if eq .Op.String "+" -}} +
{{ .Op.String }}{{ .Line }}
+ {{- end -}} + + {{- if eq .Op.String "-" -}} +
{{ .Op.String }}{{ .Line }}
+ {{- end -}} + + {{- if eq .Op.String " " -}} +
{{ .Op.String }}{{ .Line }}
+ {{- end -}} + + {{- end -}} {{- end -}} - {{- end -}} +
+ {{- end -}} + {{ end }} -- knotmirror 0.0.1