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