diff --git a/appview/pages/templates/fragments/diff.html b/appview/pages/templates/fragments/diff.html index 0e4fd83..50e2940 100644 --- a/appview/pages/templates/fragments/diff.html +++ b/appview/pages/templates/fragments/diff.html @@ -8,6 +8,26 @@ {{ $this := $commit.This }} {{ $parent := $commit.Parent }} +
+
+
+ Changed files + {{ block "statPill" $stat }} {{ end }} +
+
+ {{ range $diff }} + + {{ end }} +
+
+
+ {{ $last := sub (len $diff) 1 }} {{ range $idx, $hunk := $diff }} {{ with $hunk }} @@ -33,6 +53,8 @@ MODIFIED {{ end }} + {{ block "statPill" .Stats }} {{ end }} + {{ if .IsDelete }} {{ .Name.Old }} @@ -72,26 +94,35 @@
{{ if .IsDelete }} -

- This file has been deleted in this commit. -

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

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

+

+ This file has been deleted. +

+ {{ else if .IsCopy }} +

+ This file has been copied. +

+ {{ else if .IsRename }} +

+ This file has been renamed. +

+ {{ else if .IsBinary }} +

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

{{ else }} + {{ $name := .Name.New }}
{{- end -}} - {{ end }}
@@ -130,3 +160,16 @@ {{ end }} {{ end }} {{ end }} + +{{ define "statPill" }} +
+ {{ if and .Insertions .Deletions }} + +{{ .Insertions }} + -{{ .Deletions }} + {{ else if .Insertions }} + +{{ .Insertions }} + {{ else if .Deletions }} + -{{ .Deletions }} + {{ end }} +
+{{ end }} diff --git a/appview/pages/templates/repo/commit.html b/appview/pages/templates/repo/commit.html index 3aecab7..0185448 100644 --- a/appview/pages/templates/repo/commit.html +++ b/appview/pages/templates/repo/commit.html @@ -4,8 +4,6 @@ {{ $repo := .RepoInfo.FullName }} {{ $commit := .Diff.Commit }} -{{ $stat := .Diff.Stat }} -{{ $diff := .Diff.Diff }}
@@ -13,7 +11,7 @@

{{ index $messageParts 0 }}

{{ if gt (len $messageParts) 1 }} -

{{ nl2br (unwrapText (index $messageParts 1)) }}

+

{{ nl2br (index $messageParts 1) }}

{{ end }}
@@ -30,8 +28,6 @@ {{ timeFmt $commit.Author.When }} - {{ $stat.FilesChanged }} files (+{{ $stat.Insertions }}, -{{ $stat.Deletions }}) -

@@ -43,21 +39,6 @@

-
-
- Changed files -
- {{ range $diff }} - - {{ end }} -
-
{{end}} diff --git a/appview/pages/templates/repo/index.html b/appview/pages/templates/repo/index.html index ae84e19..7c1d809 100644 --- a/appview/pages/templates/repo/index.html +++ b/appview/pages/templates/repo/index.html @@ -146,7 +146,7 @@ {{ end }} diff --git a/appview/pages/templates/repo/issues/issues.html b/appview/pages/templates/repo/issues/issues.html index c440353..baf5934 100644 --- a/appview/pages/templates/repo/issues/issues.html +++ b/appview/pages/templates/repo/issues/issues.html @@ -4,7 +4,7 @@

filtering - diff --git a/appview/pages/templates/repo/log.html b/appview/pages/templates/repo/log.html index 36c93cb..9812dd1 100644 --- a/appview/pages/templates/repo/log.html +++ b/appview/pages/templates/repo/log.html @@ -83,7 +83,7 @@

{{ end }}
diff --git a/appview/pages/templates/repo/pulls/patch.html b/appview/pages/templates/repo/pulls/patch.html index acb3519..c819039 100644 --- a/appview/pages/templates/repo/pulls/patch.html +++ b/appview/pages/templates/repo/pulls/patch.html @@ -69,19 +69,6 @@ {{ end }} -
-
- Changed files - {{ range .Diff.Diff }} - - {{ end }} -
diff --git a/appview/pages/templates/repo/pulls/pull.html b/appview/pages/templates/repo/pulls/pull.html index b80c160..6e9f363 100644 --- a/appview/pages/templates/repo/pulls/pull.html +++ b/appview/pages/templates/repo/pulls/pull.html @@ -156,7 +156,7 @@ {{ end }} -
+
{{ end }} {{ end }} {{ end }} diff --git a/appview/pages/templates/repo/pulls/pulls.html b/appview/pages/templates/repo/pulls/pulls.html index 8149f70..663cc2c 100644 --- a/appview/pages/templates/repo/pulls/pulls.html +++ b/appview/pages/templates/repo/pulls/pulls.html @@ -5,7 +5,7 @@

filtering