From fac0abc12c38f08e4b6563952c7a864d9239102a Mon Sep 17 00:00:00 2001 From: Akshay Date: Sun, 20 Apr 2025 23:07:46 +0100 Subject: [PATCH] appview: style commits in format-patches --- appview/pages/templates/repo/pulls/pull.html | 84 ++++++++++++-------- 1 file changed, 50 insertions(+), 34 deletions(-) diff --git a/appview/pages/templates/repo/pulls/pull.html b/appview/pages/templates/repo/pulls/pull.html index 8f48edea..ab67cde8 100644 --- a/appview/pages/templates/repo/pulls/pull.html +++ b/appview/pages/templates/repo/pulls/pull.html @@ -64,46 +64,59 @@ {{ if .IsFormatPatch }} {{ $patches := .AsFormatPatch }} - {{ range $patches }} -
-
-
-
- {{ i "git-commit-horizontal" "w-4 h-4 mr-1.5" }} - {{ .Title }} - {{ if gt (len .Body) 0 }} - - {{ end }} -
-
- {{ if not $.Pull.IsPatchBased }} - {{ $fullRepo := $.RepoInfo.FullName }} - {{ if not $.Pull.IsBranchBased }} - {{ $fullRepo = printf "%s/%s" $owner $.PullSourceRepo.Name }} + {{ $round := .RoundNumber }} +
+ + {{ $s := "s" }} + {{ if eq (len $patches) 1 }} + {{ $s = "" }} + {{ end }} +
+ {{ i "chevrons-up-down" "w-4 h-4" }} expand {{ len $patches }} commit{{$s}} +
+ +
+ {{ range $patches }} +
+
+ {{ i "git-commit-horizontal" "w-4 h-4" }} +
+ {{ if not $.Pull.IsPatchBased }} + {{ $fullRepo := $.RepoInfo.FullName }} + {{ if not $.Pull.IsBranchBased }} + {{ $fullRepo = printf "%s/%s" $owner $.PullSourceRepo.Name }} + {{ end }} + {{ slice .SHA 0 8 }} + {{ else }} + {{ slice .SHA 0 8 }} {{ end }} - {{ slice .SHA 0 8 }} - {{ else }} - {{ slice .SHA 0 8 }} - {{ end }} +
+
+ {{ .Title }} + {{ if gt (len .Body) 0 }} + + {{ end }} +
+ {{ if gt (len .Body) 0 }} + + {{ end }}
- {{ if gt (len .Body) 0 }} - - {{ end }} -
-
- {{ end }} + {{ end }} + {{ end }} -
+
{{ range $cidx, $c := .Comments }}
{{ if gt $cidx 0 }} @@ -204,3 +217,6 @@
{{ end }} {{ end }} + +{{ define "commits" }} +{{ end }} -- 2.51.2