Monorepo for Tangled
at 74318eac9fdd72cf69e916276814351931ed0dcb 86 lines 2.9 kB view raw
1{{ define "title" }}issues &middot; {{ .RepoInfo.FullName }}{{ end }} 2 3{{ define "extrameta" }} 4 {{ $title := "issues"}} 5 {{ $url := printf "https://tangled.org/%s/issues" .RepoInfo.FullName }} 6 7 {{ template "repo/fragments/og" (dict "RepoInfo" .RepoInfo "Title" $title "Url" $url) }} 8{{ end }} 9 10{{ define "repoContent" }} 11 {{ $active := "closed" }} 12 {{ if .FilteringByOpen }} 13 {{ $active = "open" }} 14 {{ end }} 15 16 {{ $open := 17 (dict 18 "Key" "open" 19 "Value" "open" 20 "Icon" "circle-dot" 21 "Meta" (string .RepoInfo.Stats.IssueCount.Open)) }} 22 {{ $closed := 23 (dict 24 "Key" "closed" 25 "Value" "closed" 26 "Icon" "ban" 27 "Meta" (string .RepoInfo.Stats.IssueCount.Closed)) }} 28 {{ $values := list $open $closed }} 29 30 <div class="grid gap-2 grid-cols-[auto_1fr_auto] grid-row-2"> 31 <form class="flex relative col-span-3 sm:col-span-1 sm:col-start-2" method="GET"> 32 <input type="hidden" name="state" value="{{ if .FilteringByOpen }}open{{ else }}closed{{ end }}"> 33 <div class="flex-1 flex relative"> 34 <input 35 id="search-q" 36 class="flex-1 py-1 pl-2 pr-10 mr-[-1px] rounded-r-none peer" 37 type="text" 38 name="q" 39 value="{{ .FilterQuery }}" 40 placeholder="search issues..." 41 > 42 <a 43 href="?state={{ if .FilteringByOpen }}open{{ else }}closed{{ end }}" 44 class="absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 hidden peer-[:not(:placeholder-shown)]:block" 45 > 46 {{ i "x" "w-4 h-4" }} 47 </a> 48 </div> 49 <button 50 type="submit" 51 class="p-2 text-gray-400 border rounded-r border-gray-300 dark:border-gray-600" 52 > 53 {{ i "search" "w-4 h-4" }} 54 </button> 55 </form> 56 <div class="sm:row-start-1"> 57 {{ template "fragments/tabSelector" (dict "Name" "state" "Values" $values "Active" $active "Include" "#search-q") }} 58 </div> 59 <a 60 href="/{{ .RepoInfo.FullName }}/issues/new" 61 class="col-start-3 btn-create text-sm flex items-center justify-center gap-2 no-underline hover:no-underline hover:text-white" 62 > 63 {{ i "circle-plus" "w-4 h-4" }} 64 <span>new</span> 65 </a> 66 </div> 67 <div class="error" id="issues"></div> 68{{ end }} 69 70{{ define "repoAfter" }} 71 <div class="mt-2"> 72 {{ template "repo/issues/fragments/issueListing" (dict "Issues" .Issues "RepoPrefix" .RepoInfo.FullName "LabelDefs" .LabelDefs) }} 73 </div> 74 {{if gt .IssueCount .Page.Limit }} 75 {{ $state := "closed" }} 76 {{ if .FilteringByOpen }} 77 {{ $state = "open" }} 78 {{ end }} 79 {{ template "fragments/pagination" (dict 80 "Page" .Page 81 "TotalCount" .IssueCount 82 "BasePath" (printf "/%s/issues" .RepoInfo.FullName) 83 "QueryParams" (queryParams "state" $state "q" .FilterQuery) 84 ) }} 85 {{ end }} 86{{ end }}