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")