mirror of
https://codeberg.org/video-prize-ranch/rimgo.git
synced 2025-12-14 20:25:17 +00:00
added user comments
This commit is contained in:
38
views/partials/contextComment.hbs
Normal file
38
views/partials/contextComment.hbs
Normal file
@@ -0,0 +1,38 @@
|
||||
<!-- TODO: remove post titles and instead use cover images -->
|
||||
|
||||
<div class="flex flex-col gap-2">
|
||||
<div class="flex gap-2 items-center">
|
||||
{{#noteq this.User.Username "[deleted]"}}
|
||||
<img src="{{this.User.Avatar}}" class="rounded-full" width="24" height="24" loading="lazy">
|
||||
<p class="whitespace-nowrap text-ellipsis overflow-hidden"></p><a href="/user/{{this.User.Username}}">
|
||||
<b class="underline">{{this.User.Username}}</b></span>
|
||||
on <a class="underline" href={{Post.Link}}>post title here {{Post.Title}}</a></p>
|
||||
</a>
|
||||
{{/noteq}}
|
||||
{{#equal this.User.Username "[deleted]"}}
|
||||
<p class="whitespace-nowrap text-ellipsis overflow-hidden"><b>[deleted]</b>
|
||||
on <a class="underline" href={{Post.Link}}>post title here {{Post.Title}}</a></p>
|
||||
{{/equal}}
|
||||
</div>
|
||||
<div>
|
||||
<p>{{{this.Comment}}}</p>
|
||||
<div class="flex gap-2">
|
||||
<span title="{{this.CreatedAt}}">{{this.RelTime}}</span>
|
||||
{{#if this.DeletedAt}}
|
||||
<span class="text-md">(deleted {{this.DeletedAt}})</span>
|
||||
{{/if}}
|
||||
|
|
||||
<img class="invert icon" src="/static/icons/PhArrowFatUp.svg" alt="Likes" width="24px" height="24px">
|
||||
{{this.Upvotes}}
|
||||
<img class="invert icon" src="/static/icons/PhArrowFatDown.svg" alt="Dislikes" width="24px" height="24px">
|
||||
{{this.Downvotes}}
|
||||
</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>
|
||||
47
views/userComments.hbs
Normal file
47
views/userComments.hbs
Normal file
@@ -0,0 +1,47 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<title>{{user.Username}} - rimgo</title>
|
||||
|
||||
{{> partials/head }}
|
||||
</head>
|
||||
|
||||
<body class="font-sans text-lg bg-slate-800 text-white">
|
||||
{{> partials/nav }}
|
||||
|
||||
<section class="my-4 w-full flex flex-col items-center">
|
||||
{{> partials/searchBar }}
|
||||
</section>
|
||||
|
||||
<header class="p-4 rounded-xl text-white mb-4" style="background-image: url('{{user.Cover}}');">
|
||||
<div class="flex items-center gap-2">
|
||||
<img class="rounded-full" src="{{user.Avatar}}" width="72" height="72">
|
||||
<div>
|
||||
<h2 class="font-bold text-2xl">{{user.Username}}</h2>
|
||||
<p>{{user.Points}} pts · {{user.CreatedAt}}</p>
|
||||
</div>
|
||||
</div>
|
||||
<p class="mt-2">{{user.Bio}}</p>
|
||||
</header>
|
||||
|
||||
<main>
|
||||
<div class="comments flex flex-col gap-2">
|
||||
{{#each comments}}
|
||||
{{> partials/contextComment }}
|
||||
{{/each}}
|
||||
</div>
|
||||
|
||||
<div class="mt-4 font-bold">
|
||||
{{#equal page "0" }}
|
||||
{{else}}
|
||||
<a href="{{channel.RelUrl}}?page={{prevPage}}">Previous page</a>
|
||||
{{/equal}}
|
||||
<a href="{{channel.RelUrl}}?page={{nextPage}}">Next page</a>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
{{> partials/footer }}
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user