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