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