From e78c5099404f5493a711e2e6e72b5a0434838da7 Mon Sep 17 00:00:00 2001 From: Dominik Picheta Date: Tue, 22 May 2018 20:20:02 +0100 Subject: [PATCH] Hide banned threads in the thread list for now using CSS. --- public/css/nimforum.scss | 4 ++++ src/frontend/threadlist.nim | 11 ++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/public/css/nimforum.scss b/public/css/nimforum.scss index 23a65bc..7b5c9cb 100644 --- a/public/css/nimforum.scss +++ b/public/css/nimforum.scss @@ -248,6 +248,10 @@ $threads-meta-color: #545d70; } +#threads-list tr.banned { + display: none; // TODO: Fix server so that it doesn't send banned threads. +} + .posts, .about { @extend .grid-md; @extend .container; diff --git a/src/frontend/threadlist.nim b/src/frontend/threadlist.nim index 09c9dfe..4d330c7 100644 --- a/src/frontend/threadlist.nim +++ b/src/frontend/threadlist.nim @@ -108,15 +108,20 @@ when defined(js): proc genThread(thread: Thread, isNew: bool, noBorder: bool): VNode = let isOld = (getTime() - thread.creation.fromUnix).weeks > 2 + let isBanned = thread.author.rank < Moderated result = buildHtml(): - tr(class=class({"no-border": noBorder})): + tr(class=class({"no-border": noBorder, "banned": isBanned})): td(class="thread-title"): if thread.isLocked: italic(class="fas fa-lock fa-xs", title="Thread cannot be replied to") if thread.isModerated: - italic(class="fas fa-eye-slash fa-xs", - title="Thread is moderated") + if isBanned: + italic(class="fas fa-ban fa-xs", + title="Thread author is banned") + else: + italic(class="fas fa-eye-slash fa-xs", + title="Thread is moderated") if thread.isSolved: italic(class="fas fa-check-square fa-xs", title="Thread has a solution")