tangled
alpha
login
or
join now
tjh.dev
/
test
forked from
tangled.org/core
0
fork
atom
Mirror of @tangled.org/core. Running on a Raspberry Pi Zero 2 (Please be gentle).
0
fork
atom
overview
issues
pulls
pipelines
use nice styles for new-comment in issues
oppi.li
1 year ago
a97cea48
78b47d23
+30
-24
1 changed file
expand all
collapse all
unified
split
appview
pages
templates
repo
issues
issue.html
+30
-24
appview/pages/templates/repo/issues/issue.html
···
45
45
{{ end }}
46
46
47
47
{{ define "repoAfter" }}
48
48
+
{{ if gt (len .Comments) 0 }}
48
49
<section id="comments" class="mt-8 space-y-4 relative">
49
50
{{ range $index, $comment := .Comments }}
50
51
<div
···
53
52
class="rounded bg-white px-6 py-4 relative"
54
53
>
55
54
{{ if eq $index 0 }}
56
56
-
<div
57
57
-
class="absolute left-8 -top-8 w-px h-8 bg-gray-300"
58
58
-
></div>
55
55
+
<div class="absolute left-8 -top-8 w-px h-8 bg-gray-300" ></div>
59
56
{{ else }}
60
60
-
<div
61
61
-
class="absolute left-8 -top-4 w-px h-4 bg-gray-300"
62
62
-
></div>
57
57
+
<div class="absolute left-8 -top-4 w-px h-4 bg-gray-300" ></div>
63
58
{{ end }}
64
59
<div class="flex items-center gap-2 mb-2 text-gray-500">
65
60
{{ $owner := index $.DidHandleMap .OwnerDid }}
···
82
85
</div>
83
86
{{ end }}
84
87
</section>
85
85
-
86
86
-
{{ if .LoggedInUser }}
87
87
-
<form
88
88
-
hx-post="/{{ .RepoInfo.FullName }}/issues/{{ .Issue.IssueId }}/comment"
89
89
-
class="mt-8"
90
90
-
>
91
91
-
<textarea
92
92
-
name="body"
93
93
-
class="w-full p-2 rounded border border-gray-200"
94
94
-
placeholder="Add to the discussion..."
95
95
-
></textarea>
96
96
-
<button type="submit" class="btn mt-2">comment</button>
97
97
-
<div id="issue-comment"></div>
98
98
-
</form>
99
99
-
{{ else }}
100
100
-
<div class="w-full rounded p-6 drop-shadow-sm bg-white">
101
101
-
<a href="/login" class="underline">login</a> to join the discussion
102
102
-
</div>
103
88
{{ end }}
89
89
+
90
90
+
{{ block "newComment" . }} {{ end }}
104
91
105
92
{{ $isIssueAuthor := and .LoggedInUser (eq .LoggedInUser.Did .Issue.OwnerDid) }}
106
93
{{ $isRepoCollaborator := .RepoInfo.Roles.IsCollaborator }}
···
112
131
<div id="issue-action" class="error"></div>
113
132
</form>
114
133
{{ end }}
134
134
+
{{ end }}
135
135
+
136
136
+
{{ define "newComment" }}
137
137
+
{{ if .LoggedInUser }}
138
138
+
<div class="bg-white rounded drop-shadow-sm py-4 px-6 relative w-full flex flex-col gap-2 mt-8">
139
139
+
<div class="absolute left-8 -top-8 w-px h-8 bg-gray-300" ></div>
140
140
+
<div class="text-sm text-gray-500">
141
141
+
{{ didOrHandle .LoggedInUser.Did .LoggedInUser.Handle }}
142
142
+
</div>
143
143
+
<form hx-post="/{{ .RepoInfo.FullName }}/issues/{{ .Issue.IssueId }}/comment">
144
144
+
<textarea
145
145
+
name="body"
146
146
+
class="w-full p-2 rounded border border-gray-200"
147
147
+
placeholder="Add to the discussion..."
148
148
+
></textarea>
149
149
+
<button type="submit" class="btn mt-2">comment</button>
150
150
+
<div id="issue-comment"></div>
151
151
+
</form>
152
152
+
</div>
153
153
+
{{ else }}
154
154
+
<div class="bg-white rounded drop-shadow-sm px-6 py-4 mt-8">
155
155
+
<div class="absolute left-8 -top-8 w-px h-8 bg-gray-300" ></div>
156
156
+
<a href="/login" class="underline">login</a> to join the discussion
157
157
+
</div>
158
158
+
{{ end }}
115
159
{{ end }}