From 5fc811e797e0a49590a6dea99723d78868b0c879 Mon Sep 17 00:00:00 2001 From: Joey Yakimowich-Payne Date: Tue, 18 Feb 2020 13:54:49 -0700 Subject: [PATCH] Only hide category on category page for testing purposes --- src/frontend/threadlist.nim | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/frontend/threadlist.nim b/src/frontend/threadlist.nim index 98a1f8d..c93def1 100644 --- a/src/frontend/threadlist.nim +++ b/src/frontend/threadlist.nim @@ -109,9 +109,8 @@ when defined(js): a(href=makeUri("/t/" & $thread.id), onClick=anchorCB): text thread.topic - if displayCategory: - td(): - render(thread.category) + td(class=class({"d-none": not displayCategory})): + render(thread.category) genUserAvatars(thread.users) td(): text $thread.replies td(class=class({ @@ -187,6 +186,8 @@ when defined(js): return buildHtml(tdiv(class="loading loading-lg")) + let displayCategory = true + let list = state.list.get() result = buildHtml(): section(class="thread-list"): @@ -194,8 +195,8 @@ when defined(js): thead(): tr: th(text "Topic") - if categoryId == -1: - th(text "Category") + th(class=class({"d-none": not displayCategory})): + text "Category" th(style=style((StyleAttr.width, kstring"8rem"))): text "Users" th(text "Replies") th(text "Views") @@ -209,7 +210,7 @@ when defined(js): let (isLastUnseen, isNew) = getInfo(list.threads, i, currentUser) genThread(thread, isNew, noBorder=isLastUnseen or isLastThread, - displayCategory=categoryId == -1) + displayCategory=displayCategory) if isLastUnseen and (not isLastThread): tr(class="last-visit-separator"): td(colspan="6"):