Make categories compact by default
This commit is contained in:
parent
6c70713afb
commit
fd80f754d2
5 changed files with 6 additions and 6 deletions
|
|
@ -20,7 +20,7 @@ when defined(js):
|
||||||
import karax / [vstyles]
|
import karax / [vstyles]
|
||||||
import karaxutils
|
import karaxutils
|
||||||
|
|
||||||
proc render*(category: Category, compact=false): VNode =
|
proc render*(category: Category, compact=true): VNode =
|
||||||
if category.name.len == 0:
|
if category.name.len == 0:
|
||||||
return buildHtml():
|
return buildHtml():
|
||||||
span()
|
span()
|
||||||
|
|
|
||||||
|
|
@ -155,7 +155,7 @@ when defined(js):
|
||||||
state.onAddCategoryClick()):
|
state.onAddCategoryClick()):
|
||||||
text "Add"
|
text "Add"
|
||||||
|
|
||||||
proc render*(state: CategoryPicker, currentUser: Option[User], compact=false): VNode =
|
proc render*(state: CategoryPicker, currentUser: Option[User], compact=true): VNode =
|
||||||
let loggedIn = currentUser.isSome()
|
let loggedIn = currentUser.isSome()
|
||||||
let currentAdmin =
|
let currentAdmin =
|
||||||
loggedIn and currentUser.get().rank == Admin
|
loggedIn and currentUser.get().rank == Admin
|
||||||
|
|
@ -178,7 +178,7 @@ when defined(js):
|
||||||
tdiv(class="dropdown"):
|
tdiv(class="dropdown"):
|
||||||
a(class="btn btn-link dropdown-toggle", tabindex="0"):
|
a(class="btn btn-link dropdown-toggle", tabindex="0"):
|
||||||
tdiv(class="selected-category d-inline-block"):
|
tdiv(class="selected-category d-inline-block"):
|
||||||
render(selectedCategory, compact=true)
|
render(selectedCategory)
|
||||||
text " "
|
text " "
|
||||||
italic(class="fas fa-caret-down")
|
italic(class="fas fa-caret-down")
|
||||||
ul(class="menu"):
|
ul(class="menu"):
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ when defined(js):
|
||||||
li: text "dev" ]#
|
li: text "dev" ]#
|
||||||
if categoryId != -1:
|
if categoryId != -1:
|
||||||
catPicker.selectedCategoryID = categoryId
|
catPicker.selectedCategoryID = categoryId
|
||||||
render(catPicker, currentUser)
|
render(catPicker, currentUser, compact=false)
|
||||||
|
|
||||||
for btn in buttons:
|
for btn in buttons:
|
||||||
let active = btn.url == window.location.href
|
let active = btn.url == window.location.href
|
||||||
|
|
|
||||||
|
|
@ -215,7 +215,7 @@ when defined(js):
|
||||||
result = buildHtml():
|
result = buildHtml():
|
||||||
tdiv():
|
tdiv():
|
||||||
if authoredByUser or currentAdmin:
|
if authoredByUser or currentAdmin:
|
||||||
render(state.categoryPicker, currentUser)
|
render(state.categoryPicker, currentUser, compact=false)
|
||||||
else:
|
else:
|
||||||
render(thread.category)
|
render(thread.category)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,7 @@ when defined(js):
|
||||||
text thread.topic
|
text thread.topic
|
||||||
if displayCategory:
|
if displayCategory:
|
||||||
td():
|
td():
|
||||||
render(thread.category, compact=true)
|
render(thread.category)
|
||||||
genUserAvatars(thread.users)
|
genUserAvatars(thread.users)
|
||||||
td(): text $thread.replies
|
td(): text $thread.replies
|
||||||
td(class=class({
|
td(class=class({
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue