feat: add 'removed by moderator' + link to modlog
This commit is contained in:
3 files changed
+24
-1
No files matched your search
@@ -98,6 +98,16 @@
|
||||
content={site.counts.posts.toString()}
|
||||
formatted
|
||||
/>
|
||||
<LabelStat
|
||||
label={$t('content.comments')}
|
||||
content={site.counts.comments.toString()}
|
||||
formatted
|
||||
/>
|
||||
<LabelStat
|
||||
label={$t('cards.community.activeDay')}
|
||||
content={site.counts.users_active_day.toString()}
|
||||
formatted
|
||||
/>
|
||||
<LabelStat
|
||||
label={$t('content.communities')}
|
||||
content={site.counts.communities.toString()}
|
||||
|
||||
@@ -185,7 +185,7 @@
|
||||
<Icon src={Pencil} micro size="14" />
|
||||
</div>
|
||||
{/if}
|
||||
{#if node.comment_view.comment.deleted || node.comment_view.comment.removed}
|
||||
{#if node.comment_view.comment.deleted}
|
||||
<Icon
|
||||
src={Trash}
|
||||
solid
|
||||
@@ -194,6 +194,15 @@
|
||||
class="text-red-600 dark:text-red-500"
|
||||
/>
|
||||
{/if}
|
||||
{#if node.comment_view.comment.removed}
|
||||
<Icon
|
||||
src={Trash}
|
||||
solid
|
||||
size="12"
|
||||
aria-label={$t('post.badges.removed')}
|
||||
class="text-green-600 dark:text-green-500"
|
||||
/>
|
||||
{/if}
|
||||
{#if node.comment_view.saved}
|
||||
<Icon
|
||||
src={Bookmark}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { t } from '$lib/i18n/translations'
|
||||
import type { Comment, CommentView } from 'lemmy-js-client'
|
||||
import { SvelteMap } from 'svelte/reactivity'
|
||||
|
||||
@@ -35,6 +36,9 @@ export function buildCommentsTree(
|
||||
for (const comment_view of comments) {
|
||||
const depthI = getDepthFromComment(comment_view.comment) ?? 0
|
||||
const depth = depthI + baseDepth
|
||||
if (comment_view.comment.content == '' && comment_view.comment.removed) {
|
||||
comment_view.comment.content = `*Removed by Moderator — [${t.get('routes.modlog.title')}](/modlog?comment=${comment_view.comment.id})*`
|
||||
}
|
||||
const node: CommentNodeI = {
|
||||
comment_view,
|
||||
children: [],
|
||||
|
||||
Reference in new issue
Block a user