From 3e0c7f3908fc96fa46ab27577b29a4b34e7703af Mon Sep 17 00:00:00 2001 From: Anirudh Oppiliappan Date: Wed, 26 Feb 2025 00:50:19 +0200 Subject: [PATCH] bring back missing names in commit view + some more finessing --- appview/pages/templates/repo/commit.html | 66 +++++++++++++--------- appview/pages/templates/repo/settings.html | 2 +- 2 files changed, 40 insertions(+), 28 deletions(-) diff --git a/appview/pages/templates/repo/commit.html b/appview/pages/templates/repo/commit.html index 27e7601..94fdf27 100644 --- a/appview/pages/templates/repo/commit.html +++ b/appview/pages/templates/repo/commit.html @@ -39,15 +39,18 @@

- jump to + Affected files {{ range $diff }} - {{ end }}
- +{{end}} {{end}} {{ define "repoAfter" }} @@ -80,7 +83,11 @@ M {{ end }} - {{ .Name.New }} + {{ $name := .Name.New}} + {{ if .IsDelete }} + {{ $name = .Name.Old }} + {{ end }} + {{ $name }} {{ $iconstyle := "p-1 mx-1 hover:bg-gray-100 rounded" }} @@ -99,30 +106,35 @@ - - {{ 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 -}} + + + {{ 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 -}} +
{{- end -}} -
- {{- end -}} + {{- end -}} diff --git a/appview/pages/templates/repo/settings.html b/appview/pages/templates/repo/settings.html index 1513f54..e0cfcb7 100644 --- a/appview/pages/templates/repo/settings.html +++ b/appview/pages/templates/repo/settings.html @@ -1,6 +1,6 @@ {{ define "title" }}settings · {{ .RepoInfo.FullName }}{{ end }} {{ define "repoContent" }} -
COLLABORATORS
+
Collaborators
{{ range .Collaborators }} -- knotmirror 0.0.1