This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

core / appview / pages / templates / repo / pulls / fragments / pullCompareBranches.html
1.9 kB 43 lines
1{{ define "repo/pulls/fragments/pullCompareBranches" }} 2 <div id="patch-upload" class="flex flex-wrap gap-2 items-center"> 3 <select 4 id="sourceBranch" 5 name="sourceBranch" 6 hx-post="/{{ .RepoInfo.FullName }}/pulls/new/refresh" 7 hx-include="closest form" 8 hx-target="#pr-compose-host" 9 hx-swap="outerHTML" 10 hx-trigger="change" 11 hx-indicator="this" 12 class="peer p-1 border border-gray-200 bg-white dark:bg-gray-700 dark:text-white dark:border-gray-600" 13 > 14 <option disabled {{ if not .SourceBranch }}selected{{ end }}>Source branch</option> 15 16 {{ $recent := "" }} 17 {{ if .SourceBranches }} 18 {{ $recent = (index .SourceBranches 0).Reference.Name }} 19 {{ end }} 20 {{ range .SourceBranches }} 21 {{ $isRecent := eq .Reference.Name $recent }} 22 {{ $preset := false }} 23 {{ if $.SourceBranch }} 24 {{ $preset = eq .Reference.Name $.SourceBranch }} 25 {{ else }} 26 {{ $preset = $isRecent }} 27 {{ end }} 28 29 <option 30 value="{{ .Reference.Name }}" 31 {{ if $preset }}selected{{ end }} 32 {{ if and $.TargetBranch (eq .Reference.Name $.TargetBranch) }}disabled{{ end }} 33 class="py-1" 34 > 35 {{ .Reference.Name }} 36 {{ if $isRecent }}(New){{ end }} 37 {{ if and $.TargetBranch (eq .Reference.Name $.TargetBranch) }}(Target){{ end }} 38 </option> 39 {{ end }} 40 </select> 41 {{ i "loader-circle" "size-4 animate-spin hidden peer-[.htmx-request]:inline text-gray-500 dark:text-gray-400" }} 42 </div> 43{{ end }}