diff --git a/appview/pages/templates/repo/fragments/diff.html b/appview/pages/templates/repo/fragments/diff.html index 34da43cf..81d15b9b 100644 --- a/appview/pages/templates/repo/fragments/diff.html +++ b/appview/pages/templates/repo/fragments/diff.html @@ -13,95 +13,41 @@
{{ range $idx, $hunk := $diff }} {{ with $hunk }} -
-
-
-
- -
-
-
- {{ $markerstyle := "diff-type p-1 mr-1 font-mono text-sm rounded select-none" }} - {{ if .IsNew }} - ADDED - {{ else if .IsDelete }} - DELETED - {{ else if .IsCopy }} - COPIED - {{ else if .IsRename }} - RENAMED - {{ else }} - MODIFIED - {{ end }} - - {{ template "repo/fragments/diffStatPill" .Stats }} -
- -
- {{ if .IsDelete }} - - {{ .Name.Old }} - - {{ else if (or .IsCopy .IsRename) }} - - {{ .Name.Old }} - - {{ i "arrow-right" "w-4 h-4" }} - - {{ .Name.New }} - - {{ else }} - - {{ .Name.New }} - - {{ end }} -
-
- - {{ $iconstyle := "p-1 mx-1 hover:bg-gray-100 dark:hover:bg-gray-700 rounded" }} -
- {{ i "arrow-up-to-line" "w-4 h-4" }} - {{ if gt $idx 0 }} - {{ $prev := index $diff (sub $idx 1) }} - {{ i "arrow-up" "w-4 h-4" }} - {{ end }} - - {{ if lt $idx $last }} - {{ $next := index $diff (add $idx 1) }} - {{ i "arrow-down" "w-4 h-4" }} - {{ end }} -
- -
-
- -
- {{ if .IsDelete }} -

- This file has been deleted. -

- {{ else if .IsCopy }} -

- This file has been copied. -

- {{ else if .IsBinary }} -

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

- {{ else }} - {{ if $isSplit }} - {{- template "repo/fragments/splitDiff" .Split -}} +
+ +
+
+ {{ i "chevron-right" "w-4 h-4" }} + + {{ template "repo/fragments/diffStatPill" .Stats }} + +
+ {{ if .IsDelete }} + {{ .Name.Old }} + {{ else if (or .IsCopy .IsRename) }} + {{ .Name.Old }} {{ i "arrow-right" "w-4 h-4" }} {{ .Name.New }} {{ else }} - {{- template "repo/fragments/unifiedDiff" . -}} + {{ .Name.New }} {{ end }} - {{- end -}} +
- -
- +
+ + +
+ {{ if .IsBinary }} +

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

+ {{ else }} + {{ if $isSplit }} + {{- template "repo/fragments/splitDiff" .Split -}} + {{ else }} + {{- template "repo/fragments/unifiedDiff" . -}} + {{ end }} + {{- end -}}
-
-
+ {{ end }} {{ end }}
diff --git a/appview/pages/templates/repo/fragments/interdiff.html b/appview/pages/templates/repo/fragments/interdiff.html index d66d73c9..14ea8c7f 100644 --- a/appview/pages/templates/repo/fragments/interdiff.html +++ b/appview/pages/templates/repo/fragments/interdiff.html @@ -10,81 +10,56 @@
{{ range $idx, $hunk := $diff }} {{ with $hunk }} -
-
-
-
- -
-
-
- {{ $markerstyle := "diff-type p-1 mr-1 font-mono text-sm rounded select-none" }} - {{ if .Status.IsOk }} - CHANGED - {{ else if .Status.IsUnchanged }} - UNCHANGED - {{ else if .Status.IsOnlyInOne }} - REVERTED - {{ else if .Status.IsOnlyInTwo }} - NEW - {{ else if .Status.IsRebased }} - REBASED - {{ else }} - ERROR - {{ end }} -
- - -
- - {{ $iconstyle := "p-1 mx-1 hover:bg-gray-100 dark:hover:bg-gray-700 rounded" }} -
- {{ i "arrow-up-to-line" "w-4 h-4" }} - {{ if gt $idx 0 }} - {{ $prev := index $diff (sub $idx 1) }} - {{ i "arrow-up" "w-4 h-4" }} - {{ end }} - - {{ if lt $idx $last }} - {{ $next := index $diff (add $idx 1) }} - {{ i "arrow-down" "w-4 h-4" }} - {{ end }} -
- -
-
- -
- {{ if .Status.IsUnchanged }} -

- This file has not been changed. -

- {{ else if .Status.IsRebased }} -

- This patch was likely rebased, as context lines do not match. -

- {{ else if .Status.IsError }} -

- Failed to calculate interdiff for this file. -

- {{ else }} - {{ if $isSplit }} - {{- template "repo/fragments/splitDiff" .Split -}} +
+ +
+
+
+ {{ $markerstyle := "diff-type p-1 mr-1 font-mono text-sm rounded select-none" }} + {{ if .Status.IsOk }} + CHANGED + {{ else if .Status.IsUnchanged }} + UNCHANGED + {{ else if .Status.IsOnlyInOne }} + REVERTED + {{ else if .Status.IsOnlyInTwo }} + NEW + {{ else if .Status.IsRebased }} + REBASED {{ else }} - {{- template "repo/fragments/unifiedDiff" . -}} + ERROR {{ end }} - {{- end -}} +
+ +
{{ .Name }}
-
+
+ +
+ {{ if .Status.IsUnchanged }} +

+ This file has not been changed. +

+ {{ else if .Status.IsRebased }} +

+ This patch was likely rebased, as context lines do not match. +

+ {{ else if .Status.IsError }} +

+ Failed to calculate interdiff for this file. +

+ {{ else }} + {{ if $isSplit }} + {{- template "repo/fragments/splitDiff" .Split -}} + {{ else }} + {{- template "repo/fragments/unifiedDiff" . -}} + {{ end }} + {{- end -}}
-
-
+ + {{ end }} {{ end }}