Files
rimgo/views/partials/comment.hbs
orangix 14192e2943 change Album and Tag to use encoding/json
* move sanitization code to views

* split Tag into Tag and the subset TagMeta to match Imgur API

* make the code to parse an array generic

* change some of the views to match
2026-01-26 03:08:54 +01:00

32 lines
1.3 KiB
Handlebars

<div class="flex flex-col gap-2">
<div class="flex gap-2 items-center">
{{#noteq this.Account.Username "[deleted]"}}
<img src="{{rewriteUrl(this.Account.Avatar)}}" class="rounded-full" width="24" height="24" loading="lazy">
<a href="/user/{{this.Account.Username}}">
<p class="whitespace-nowrap text-ellipsis overflow-hidden"><b>{{this.Account.Username}}</b></p>
</a>
{{/noteq}}
{{#equal this.Account.Username "[deleted]"}}
<p class="whitespace-nowrap text-ellipsis overflow-hidden"><b>[deleted]</b></p>
{{/equal}}
</div>
<div>
<p>{{{sanitizeComment(this.Comment)}}}</p>
<div class="flex gap-2">
<span title="{{this.CreatedAt}}">{{relTime(this.CreatedAt)}}</span>
{{#ifNonZeroTime this.DeletedAt}}
<span class="text-md">(deleted {{this.DeletedAt}})</span>
{{/ifNonZeroTime}}
|
<img class="invert icon" src="/static/icons/PhArrowFatUp.svg" alt="Likes" width="24px" height="24px"> {{this.UpvoteCount}}
<img class="invert icon" src="/static/icons/PhArrowFatDown.svg" alt="Dislikes" width="24px" height="24px"> {{this.DownvoteCount}}
</div>
</div>
{{#if this.Comments}}
<div class="ml-4 p-2 border-solid border-l-2 border-slate-400">
{{#each this.Comments}}
{{> partials/comment }}
{{/each}}
</div>
{{/if}}
</div>