From 0918a3ba6a1de43ac76e84b4bf6c9c2007397edf Mon Sep 17 00:00:00 2001 From: oppiliappan Date: Thu, 22 May 2025 14:13:10 +0100 Subject: [PATCH] appview: pulls: revert pullHeader fragment to original state the stacking working introduced some unnecessary changes here --- .../repo/pulls/fragments/pullHeader.html | 153 +++++++----------- 1 file changed, 57 insertions(+), 96 deletions(-) diff --git a/appview/pages/templates/repo/pulls/fragments/pullHeader.html b/appview/pages/templates/repo/pulls/fragments/pullHeader.html index a9f439a9..4e1b90ec 100644 --- a/appview/pages/templates/repo/pulls/fragments/pullHeader.html +++ b/appview/pages/templates/repo/pulls/fragments/pullHeader.html @@ -1,108 +1,69 @@ {{ define "repo/pulls/fragments/pullHeader" }} -
- {{ block "pullState" .Pull }} {{ end }} -

- {{ .Pull.Title }} - #{{ .Pull.PullId }} -

-
+
+

+ {{ .Pull.Title }} + #{{ .Pull.PullId }} +

+
-
-
- - opened by - {{ $owner := index $.DidHandleMap .Pull.OwnerDid }} - {{ $owner }} - - - - - targeting - - {{ .Pull.TargetBranch }} - - - {{ if not .Pull.IsPatchBased }} - from - - {{ if .Pull.IsForkBased }} - {{ if .Pull.PullSource.Repo }} - {{ $owner }}/{{ .Pull.PullSource.Repo.Name }}: - {{- else -}} - [deleted fork] - {{- end -}} - {{- end -}} - {{- .Pull.PullSource.Branch -}} - - {{ end }} - -
- - {{ if .Pull.Body }} -
- {{ .Pull.Body | markdown }} -
- {{ end }} -
- -{{ end }} - -{{ define "singlePullHeader" }} -{{ end }} +{{ $bgColor := "bg-gray-800 dark:bg-gray-700" }} +{{ $icon := "ban" }} -{{ define "stackedPullHeader" }} -
- {{ block "stackedPullHeaderAbove" . }} {{ end }} -
- {{ block "singlePullHeader" . }} {{ end }} -
- {{ block "stackedPullHeaderBelow" . }} {{ end }} -
+{{ if .Pull.State.IsOpen }} + {{ $bgColor = "bg-green-600 dark:bg-green-700" }} + {{ $icon = "git-pull-request" }} +{{ else if .Pull.State.IsMerged }} + {{ $bgColor = "bg-purple-600 dark:bg-purple-700" }} + {{ $icon = "git-merge" }} {{ end }} -{{ define "stackedPullHeaderAbove" }} - {{ if .Pull.IsStacked }} - {{ $above := .Stack.StrictlyAbove .Pull }} -
- {{ range $pull := $above }} -
- {{ block "summarizedHeader" (list $pull $) }} {{ end }} +
+
+
+ {{ i $icon "w-4 h-4 mr-1.5 text-white" }} + {{ .Pull.State.String }}
- {{ end }} -
- {{ end }} -{{ end }} + + opened by + {{ $owner := index $.DidHandleMap .Pull.OwnerDid }} + {{ $owner }} + + -{{ define "stackedPullHeaderBelow" }} - {{ if .Pull.IsStacked }} - {{ $below := .Stack.StrictlyBelow .Pull }} -
- {{ range $pull := $below }} -
- {{ block "summarizedHeader" (list $pull $) }} {{ end }} -
- {{ end }} + + + targeting + + {{ .Pull.TargetBranch }} + + + {{ if not .Pull.IsPatchBased }} + from + + {{ if .Pull.IsForkBased }} + {{ if .Pull.PullSource.Repo }} + {{ $owner }}/{{ .Pull.PullSource.Repo.Name }}: + {{- else -}} + [deleted fork] + {{- end -}} + {{- end -}} + {{- .Pull.PullSource.Branch -}} + + {{ end }} +
- {{ end }} -{{ end }} -{{ define "pullState" }} - {{ $bgColor := "bg-gray-800 dark:bg-gray-700" }} - {{ $icon := "ban" }} + {{ if .Pull.Body }} +
+ {{ .Pull.Body | markdown }} +
+ {{ end }} +
- {{ if .State.IsOpen }} - {{ $bgColor = "bg-green-600 dark:bg-green-700" }} - {{ $icon = "git-pull-request" }} - {{ else if .State.IsMerged }} - {{ $bgColor = "bg-purple-600 dark:bg-purple-700" }} - {{ $icon = "git-merge" }} - {{ else if .State.IsDeleted }} - {{ $bgColor = "bg-red-600 dark:bg-red-700" }} - {{ $icon = "git-pull-request-closed" }} - {{ end }} -
- {{ i $icon "w-4 h-4 mr-1.5 text-white" }} - {{ .State.String }} -
{{ end }} -- 2.51.2