···
11
-
{{ define "summarizedHeader" }}
12
-
<div class="flex text-sm items-center justify-between w-full">
13
-
<div class="flex items-center gap-2 min-w-0 flex-1 pr-2">
14
-
<div class="flex-shrink-0">
15
-
{{ block "summarizedPullState" . }} {{ end }}
17
-
<span class="truncate text-sm text-gray-800 dark:text-gray-200">
18
-
<span class="text-gray-500 dark:text-gray-400">#{{ .PullId }}</span>
23
-
<div class="flex-shrink-0">
24
-
{{ $latestRound := .LastRoundNumber }}
25
-
{{ $lastSubmission := index .Submissions $latestRound }}
26
-
{{ $commentCount := len $lastSubmission.Comments }}
28
-
<div class="inline-flex items-center gap-2">
29
-
{{ i "message-square" "w-3 h-3 md:hidden" }}
31
-
<span class="hidden md:inline">comment{{if ne $commentCount 1}}s{{end}}</span>
34
-
<span class="mx-2 before:content-['·'] before:select-none"></span>
36
-
<span class="hidden md:inline">round</span>
37
-
<span class="font-mono">#{{ $latestRound }}</span>
43
-
{{ define "summarizedPullState" }}
44
-
{{ $fgColor := "text-gray-600 dark:text-gray-300" }}
45
-
{{ $icon := "ban" }}
47
-
{{ if .State.IsOpen }}
48
-
{{ $fgColor = "text-green-600 dark:text-green-500" }}
49
-
{{ $icon = "git-pull-request" }}
50
-
{{ else if .State.IsMerged }}
51
-
{{ $fgColor = "text-purple-600 dark:text-purple-500" }}
52
-
{{ $icon = "git-merge" }}
53
-
{{ else if .State.IsDeleted }}
54
-
{{ $fgColor = "text-red-600 dark:text-red-500" }}
55
-
{{ $icon = "git-pull-request-closed" }}
58
-
{{ $style := printf "w-4 h-4 %s" $fgColor }}
60
-
{{ i $icon $style }}
···
<div class="{{ if not $isCurrent }} pl-6 {{ end }} flex-grow min-w-0 w-full py-2">
80
-
{{ block "summarizedHeader" $pull }} {{ end }}
28
+
{{ template "repo/pulls/fragments/summarizedHeader" $pull }}