appview/pages: simplify styles in all pulls page #379

merged
opened by oppi.li targeting master from push-pvpnsqvvzuky
Changed files
+33 -49
appview
pages
templates
repo
pulls
+33 -49
appview/pages/templates/repo/pulls/pulls.html
···
{{ template "repo/fragments/time" .Created }}
</span>
+
+
{{ $latestRound := .LastRoundNumber }}
+
{{ $lastSubmission := index .Submissions $latestRound }}
+
<span class="before:content-['·']">
-
targeting
-
<span class="text-xs rounded bg-gray-100 dark:bg-gray-700 text-black dark:text-white font-mono px-2 mx-1/2 inline-flex items-center">
-
{{ .TargetBranch }}
-
</span>
-
</span>
-
{{ if not .IsPatchBased }}
-
from
-
<span class="text-xs rounded bg-gray-100 dark:bg-gray-700 text-black dark:text-white font-mono px-2 mx-1/2 inline-flex items-center">
-
{{ if .IsForkBased }}
-
{{ if .PullSource.Repo }}
-
<a href="/{{ $owner }}/{{ .PullSource.Repo.Name }}" class="no-underline hover:underline">{{ $owner }}/{{ .PullSource.Repo.Name }}</a>:
-
{{- else -}}
-
<span class="italic">[deleted fork]</span>
-
{{- end -}}
-
{{- end -}}
-
{{- .PullSource.Branch -}}
+
{{ $commentCount := len $lastSubmission.Comments }}
+
{{ $s := "s" }}
+
{{ if eq $commentCount 1 }}
+
{{ $s = "" }}
+
{{ end }}
+
+
{{ len $lastSubmission.Comments}} comment{{$s}}
</span>
-
{{ end }}
-
<span class="before:content-['·']">
-
{{ $latestRound := .LastRoundNumber }}
-
{{ $lastSubmission := index .Submissions $latestRound }}
-
round
-
<span class="text-xs rounded bg-gray-100 dark:bg-gray-700 text-black dark:text-white font-mono px-2 mx-1/2 inline-flex items-center">
-
#{{ .LastRoundNumber }}
-
</span>
-
{{ $commentCount := len $lastSubmission.Comments }}
-
{{ $s := "s" }}
-
{{ if eq $commentCount 1 }}
-
{{ $s = "" }}
-
{{ end }}
-
{{ if eq $commentCount 0 }}
-
awaiting comments
-
{{ else }}
-
recieved {{ len $lastSubmission.Comments}} comment{{$s}}
-
{{ end }}
+
<span class="before:content-['·']">
+
round
+
<span class="font-mono">
+
#{{ .LastRoundNumber }}
+
</span>
</span>
</p>
</div>
{{ if .StackId }}
{{ $otherPulls := index $.Stacks .StackId }}
-
<details class="bg-white dark:bg-gray-800 group">
-
<summary class="pb-4 px-6 text-xs list-none cursor-pointer hover:text-gray-500 hover:dark:text-gray-400">
-
{{ $s := "s" }}
-
{{ if eq (len $otherPulls) 1 }}
-
{{ $s = "" }}
-
{{ end }}
-
<div class="group-open:hidden flex items-center gap-2">
-
{{ i "chevrons-up-down" "w-4 h-4" }} expand {{ len $otherPulls }} pull{{$s}} in this stack
-
</div>
-
<div class="hidden group-open:flex items-center gap-2">
-
{{ i "chevrons-down-up" "w-4 h-4" }} hide {{ len $otherPulls }} pull{{$s}} in this stack
-
</div>
-
</summary>
-
{{ block "pullList" (list $otherPulls $) }} {{ end }}
-
</details>
+
{{ if gt (len $otherPulls) 0 }}
+
<details class="bg-white dark:bg-gray-800 group">
+
<summary class="pb-4 px-6 text-xs list-none cursor-pointer hover:text-gray-500 hover:dark:text-gray-400">
+
{{ $s := "s" }}
+
{{ if eq (len $otherPulls) 1 }}
+
{{ $s = "" }}
+
{{ end }}
+
<div class="group-open:hidden flex items-center gap-2">
+
{{ i "chevrons-up-down" "w-4 h-4" }} expand {{ len $otherPulls }} pull{{$s}} in this stack
+
</div>
+
<div class="hidden group-open:flex items-center gap-2">
+
{{ i "chevrons-down-up" "w-4 h-4" }} hide {{ len $otherPulls }} pull{{$s}} in this stack
+
</div>
+
</summary>
+
{{ block "pullList" (list $otherPulls $) }} {{ end }}
+
</details>
+
{{ end }}
{{ end }}
</div>
{{ end }}