this repo has no description
1{{ define "title" }}{{ .Issue.Title }} · issue #{{ .Issue.IssueId }} · {{ .RepoInfo.FullName }}{{ end }}
2
3
4{{ define "extrameta" }}
5 {{ $title := printf "%s · issue #%d · %s" .Issue.Title .Issue.IssueId .RepoInfo.FullName }}
6 {{ $url := printf "https://tangled.org/%s/issues/%d" .RepoInfo.FullName .Issue.IssueId }}
7
8 {{ template "repo/fragments/og" (dict "RepoInfo" .RepoInfo "Title" $title "Url" $url) }}
9{{ end }}
10
11{{ define "repoContentLayout" }}
12 <div class="grid grid-cols-1 md:grid-cols-10 gap-4 w-full">
13 <div class="col-span-1 md:col-span-8">
14 <section class="bg-white dark:bg-gray-800 p-6 rounded relative w-full mx-auto dark:text-white">
15 {{ block "repoContent" . }}{{ end }}
16 </section>
17 {{ block "repoAfter" . }}{{ end }}
18 </div>
19 <div class="col-span-1 md:col-span-2 flex flex-col gap-6">
20 {{ template "repo/fragments/labelPanel"
21 (dict "RepoInfo" $.RepoInfo
22 "Defs" $.LabelDefs
23 "Subject" $.Issue.AtUri
24 "State" $.Issue.Labels) }}
25 {{ template "issueParticipants" . }}
26 </div>
27 </div>
28{{ end }}
29
30{{ define "repoContent" }}
31<section id="issue-{{ .Issue.IssueId }}">
32 {{ template "issueHeader" .Issue }}
33 {{ template "issueInfo" . }}
34 {{ if .Issue.Body }}
35 <article id="body" class="mt-4 prose dark:prose-invert">{{ .Issue.Body | markdown }}</article>
36 {{ end }}
37 <div class="flex flex-wrap gap-2 items-stretch mt-4">
38 {{ template "issueReactions" . }}
39 </div>
40</section>
41{{ end }}
42
43{{ define "issueHeader" }}
44 <header class="pb-2">
45 <h1 class="text-2xl">
46 {{ .Title | description }}
47 <span class="text-gray-500 dark:text-gray-400">#{{ .IssueId }}</span>
48 </h1>
49 </header>
50{{ end }}
51
52{{ define "issueInfo" }}
53 {{ $bgColor := "bg-gray-800 dark:bg-gray-700" }}
54 {{ $icon := "ban" }}
55 {{ if eq .Issue.State "open" }}
56 {{ $bgColor = "bg-green-600 dark:bg-green-700" }}
57 {{ $icon = "circle-dot" }}
58 {{ end }}
59 <div class="inline-flex items-center gap-2">
60 <div id="state"
61 class="inline-flex items-center rounded px-3 py-1 {{ $bgColor }}">
62 {{ i $icon "w-4 h-4 mr-1.5 text-white" }}
63 <span class="text-white">{{ .Issue.State }}</span>
64 </div>
65 <span class="text-gray-500 dark:text-gray-400 text-sm flex flex-wrap items-center gap-1">
66 opened by
67 {{ template "user/fragments/picHandleLink" .Issue.Did }}
68 <span class="select-none before:content-['\00B7']"></span>
69 {{ if .Issue.Edited }}
70 edited {{ template "repo/fragments/time" .Issue.Edited }}
71 {{ else }}
72 {{ template "repo/fragments/time" .Issue.Created }}
73 {{ end }}
74 </span>
75
76 {{ if and .LoggedInUser (eq .LoggedInUser.Did .Issue.Did) }}
77 {{ template "issueActions" . }}
78 {{ end }}
79 </div>
80 <div id="issue-actions-error" class="error"></div>
81{{ end }}
82
83{{ define "issueActions" }}
84 {{ template "editIssue" . }}
85 {{ template "deleteIssue" . }}
86{{ end }}
87
88{{ define "editIssue" }}
89 <a
90 class="text-gray-500 dark:text-gray-400 flex gap-1 items-center group"
91 hx-get="/{{ .RepoInfo.FullName }}/issues/{{ .Issue.IssueId }}/edit"
92 hx-swap="innerHTML"
93 hx-target="#issue-{{.Issue.IssueId}}">
94 {{ i "pencil" "size-3" }}
95 </a>
96{{ end }}
97
98{{ define "deleteIssue" }}
99 <a
100 class="text-gray-500 dark:text-gray-400 flex gap-1 items-center group"
101 hx-delete="/{{ .RepoInfo.FullName }}/issues/{{ .Issue.IssueId }}/"
102 hx-confirm="Are you sure you want to delete your issue?"
103 hx-swap="none">
104 {{ i "trash-2" "size-3" }}
105 {{ i "loader-circle" "size-3 animate-spin hidden group-[.htmx-request]:inline" }}
106 </a>
107{{ end }}
108
109{{ define "issueReactions" }}
110 <div class="flex items-center gap-2">
111 {{ template "repo/fragments/reactionsPopUp" .OrderedReactionKinds }}
112 {{ range $kind := .OrderedReactionKinds }}
113 {{
114 template "repo/fragments/reaction"
115 (dict
116 "Kind" $kind
117 "Count" (index $.Reactions $kind)
118 "IsReacted" (index $.UserReacted $kind)
119 "ThreadAt" $.Issue.AtUri)
120 }}
121 {{ end }}
122 </div>
123{{ end }}
124
125{{ define "issueParticipants" }}
126 {{ $all := .Issue.Participants }}
127 {{ $ps := take $all 5 }}
128 <div>
129 <div class="py-1 flex items-center text-sm">
130 <span class="font-bold text-gray-500 dark:text-gray-400 capitalize">Participants</span>
131 <span class="bg-gray-200 dark:bg-gray-700 rounded py-1/2 px-1 ml-1">{{ len $all }}</span>
132 </div>
133 <div class="flex items-center -space-x-3 mt-2">
134 {{ $c := "z-50 z-40 z-30 z-20 z-10" }}
135 {{ range $i, $p := $ps }}
136 <img
137 src="{{ tinyAvatar . }}"
138 alt=""
139 class="rounded-full h-8 w-8 mr-1 border-2 border-gray-100 dark:border-gray-900 z-{{sub 5 $i}}0"
140 />
141 {{ end }}
142
143 {{ if gt (len $all) 5 }}
144 <span class="pl-4 text-gray-500 dark:text-gray-400 text-sm">
145 +{{ sub (len $all) 5 }}
146 </span>
147 {{ end }}
148 </div>
149 </div>
150{{ end }}
151
152{{ define "repoAfter" }}
153 <div class="flex flex-col gap-4 mt-4">
154 {{
155 template "repo/issues/fragments/commentList"
156 (dict
157 "RepoInfo" $.RepoInfo
158 "LoggedInUser" $.LoggedInUser
159 "Issue" $.Issue
160 "CommentList" $.Issue.CommentList)
161 }}
162
163 {{ template "repo/issues/fragments/newComment" . }}
164 </div>
165{{ end }}