this repo has no description
1{{ define "title" }}{{ .Issue.Title }} · issue #{{ .Issue.IssueId }} ·{{ .RepoInfo.FullName }}{{ end }}
2
3{{ define "repoContent" }}
4 <header class="pb-4">
5 <h1 class="text-2xl">
6 {{ .Issue.Title }}
7 <span class="text-gray-500 dark:text-gray-400">#{{ .Issue.IssueId }}</span>
8 </h1>
9 </header>
10
11 {{ $bgColor := "bg-gray-800 dark:bg-gray-700" }}
12 {{ $icon := "ban" }}
13 {{ if eq .State "open" }}
14 {{ $bgColor = "bg-green-600 dark:bg-green-700" }}
15 {{ $icon = "circle-dot" }}
16 {{ end }}
17
18 <section class="mt-2">
19 <div class="inline-flex items-center gap-2">
20 <div id="state"
21 class="inline-flex items-center rounded px-3 py-1 {{ $bgColor }}">
22 {{ i $icon "w-4 h-4 mr-1.5 text-white" }}
23 <span class="text-white">{{ .State }}</span>
24 </div>
25 <span class="text-gray-500 dark:text-gray-400 text-sm">
26 opened by
27 {{ $owner := didOrHandle .Issue.OwnerDid .IssueOwnerHandle }}
28 <a href="/{{ $owner }}" class="no-underline hover:underline"
29 >{{ $owner }}</a
30 >
31 <span class="px-1 select-none before:content-['\00B7']"></span>
32 <time title="{{ .Issue.Created | longTimeFmt }}">
33 {{ .Issue.Created | timeFmt }}
34 </time>
35 </span>
36 </div>
37
38 {{ if .Issue.Body }}
39 <article id="body" class="mt-8 prose dark:prose-invert">
40 {{ .Issue.Body | markdown }}
41 </article>
42 {{ end }}
43 </section>
44{{ end }}
45
46{{ define "repoAfter" }}
47 {{ if gt (len .Comments) 0 }}
48 <section id="comments" class="mt-8 space-y-4 relative">
49 {{ range $index, $comment := .Comments }}
50 <div
51 id="comment-{{ .CommentId }}"
52 class="rounded bg-white px-6 py-4 relative dark:bg-gray-800"
53 >
54 {{ if eq $index 0 }}
55 <div class="absolute left-8 -top-8 w-px h-8 bg-gray-300 dark:bg-gray-700" ></div>
56 {{ else }}
57 <div class="absolute left-8 -top-4 w-px h-4 bg-gray-300 dark:bg-gray-700" ></div>
58 {{ end }}
59 <div class="flex items-center gap-2 mb-2 text-gray-500 dark:text-gray-400">
60 {{ $owner := index $.DidHandleMap .OwnerDid }}
61 <span class="text-sm">
62 <a
63 href="/{{ $owner }}"
64 class="no-underline hover:underline"
65 >{{ $owner }}</a
66 >
67 </span>
68
69 <span class="before:content-['·']"></span>
70 <a
71 href="#{{ .CommentId }}"
72 class="text-gray-500 text-sm hover:text-gray-500 hover:underline no-underline dark:text-gray-400 dark:hover:text-gray-300 dark:hover:bg-gray-800"
73 id="{{ .CommentId }}"
74 title="{{ .Created | longTimeFmt }}"
75 >
76 {{ .Created | timeFmt }}
77 </a>
78 </div>
79 <div class="prose dark:prose-invert">
80 {{ .Body | markdown }}
81 </div>
82 </div>
83 {{ end }}
84 </section>
85 {{ end }}
86
87 {{ block "newComment" . }} {{ end }}
88
89 {{ $isIssueAuthor := and .LoggedInUser (eq .LoggedInUser.Did .Issue.OwnerDid) }}
90 {{ $isRepoCollaborator := .RepoInfo.Roles.IsCollaborator }}
91 {{ if or $isIssueAuthor $isRepoCollaborator }}
92 {{ $action := "close" }}
93 {{ $icon := "circle-x" }}
94 {{ $hoverColor := "red" }}
95 {{ if eq .State "closed" }}
96 {{ $action = "reopen" }}
97 {{ $icon = "circle-dot" }}
98 {{ $hoverColor = "green" }}
99 {{ end }}
100 <form
101 hx-post="/{{ .RepoInfo.FullName }}/issues/{{ .Issue.IssueId }}/{{ $action }}"
102 hx-swap="none"
103 class="mt-8"
104 >
105 <button type="submit" class="btn hover:bg-{{ $hoverColor }}-300">
106 {{ i $icon "w-4 h-4 mr-2" }}
107 <span class="text-black dark:text-gray-400">{{ $action }}</span>
108 </button>
109 <div id="issue-action" class="error"></div>
110 </form>
111 {{ end }}
112{{ end }}
113
114{{ define "newComment" }}
115 {{ if .LoggedInUser }}
116 <div class="bg-white rounded drop-shadow-sm py-4 px-6 relative w-full flex flex-col gap-2 mt-8 dark:bg-gray-800 dark:text-gray-400">
117 <div class="absolute left-8 -top-8 w-px h-8 bg-gray-300 dark:bg-gray-700" ></div>
118 <div class="text-sm text-gray-500 dark:text-gray-400">
119 {{ didOrHandle .LoggedInUser.Did .LoggedInUser.Handle }}
120 </div>
121 <form hx-post="/{{ .RepoInfo.FullName }}/issues/{{ .Issue.IssueId }}/comment">
122 <textarea
123 name="body"
124 class="w-full p-2 rounded border border-gray-200 dark:border-gray-700"
125 placeholder="Add to the discussion..."
126 ></textarea>
127 <button type="submit" class="btn mt-2">comment</button>
128 <div id="issue-comment"></div>
129 </form>
130 </div>
131 {{ else }}
132 <div class="bg-white rounded drop-shadow-sm px-6 py-4 mt-8">
133 <div class="absolute left-8 -top-8 w-px h-8 bg-gray-300 dark:bg-gray-700" ></div>
134 <a href="/login" class="underline">login</a> to join the discussion
135 </div>
136 {{ end }}
137{{ end }}