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