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