From c165c447685d68c2b0b2293a31937a903394f943 Mon Sep 17 00:00:00 2001 From: Anirudh Oppiliappan Date: Mon, 12 Dec 2022 17:17:49 +0530 Subject: git, routes: commit diff view --- templates/commit.html | 52 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 templates/commit.html (limited to 'templates/commit.html') diff --git a/templates/commit.html b/templates/commit.html new file mode 100644 index 0000000..e6af551 --- /dev/null +++ b/templates/commit.html @@ -0,0 +1,52 @@ +{{ define "commit" }} + +{{ template "head" . }} + +
+

{{ .meta.Title }}

+

{{ .meta.Description }}

+
+ + {{ template "nav" . }} +
+
+

author: {{ .commit.Author.Name }} <{{ .commit.Author.Email}}> on {{ .commit.Author.When }}

+

commit: + {{ .commit.This }} + +

+

parent: + {{ .commit.Parent }} + +

+

{{ .stat.FilesChanged }} files changed, + {{ .stat.Insertions }} insertions(+), + {{ .stat.Deletions }} deletions(-) +

+
+
+ {{ range .diff }} + {{ if .Name.Old }} +

{{ .Name.Old }} → {{ .Name.New }}

+ {{ else }} +

{{.Name.New }}

+ {{- end -}} +
+            {{- range .TextFragments -}}
+            

{{- .Header -}}

+ {{- range .Lines -}} + {{- if eq .Op.String "+" -}} + {{ .String }} + {{- end -}} + {{- if eq .Op.String "-" -}} + {{ .String }} + {{- end -}} + {{- end -}} + {{- end -}} +
+ {{ end }} +
+
+ + +{{ end }} -- cgit