mirror of
https://github.com/httpjamesm/AnonymousOverflow.git
synced 2025-05-14 05:52:54 +00:00
refactor: convert comments to a reusable template
This commit is contained in:
parent
e6915ae849
commit
b038d2c502
2 changed files with 27 additions and 50 deletions
25
templates/comments.html
Normal file
25
templates/comments.html
Normal file
|
@ -0,0 +1,25 @@
|
|||
<details class="comments">
|
||||
<summary>
|
||||
Show <b>{{ (len .Comments) }} comments</b>
|
||||
</summary>
|
||||
<div class="comments-parent">
|
||||
{{ range $comment := .Comments }}
|
||||
<div class="comment-parent">
|
||||
<div class="comment">
|
||||
<div class="comment-body">
|
||||
{{ $comment.Text }}
|
||||
</div>
|
||||
<div class="comment-author">
|
||||
Commented {{ $comment.Timestamp }} by
|
||||
<a
|
||||
href="https://stackoverflow.com{{ $comment.AuthorURL }}"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>{{ $comment.AuthorName }}</a
|
||||
>.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</details>
|
Loading…
Add table
Add a link
Reference in a new issue