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