nitter/src/views/list.nim

30 lines
876 B
Nim
Raw Normal View History

2021-12-27 01:37:38 +00:00
# SPDX-License-Identifier: AGPL-3.0-only
2019-09-20 23:08:30 +00:00
import strformat
import karax/[karaxdsl, vdom]
import renderutils
2020-06-01 00:22:22 +00:00
import ".."/[types, utils]
2019-09-20 23:08:30 +00:00
proc renderListTabs*(query: Query; path: string): VNode =
buildHtml(ul(class="tab")):
li(class=query.getTabClass(posts)):
a(href=(path)): text "Tweets"
li(class=query.getTabClass(userList)):
2019-09-20 23:08:30 +00:00
a(href=(path & "/members")): text "Members"
2020-06-01 00:22:22 +00:00
proc renderList*(body: VNode; query: Query; list: List): VNode =
2019-09-20 23:08:30 +00:00
buildHtml(tdiv(class="timeline-container")):
2020-06-01 00:22:22 +00:00
if list.banner.len > 0:
tdiv(class="timeline-banner"):
a(href=getPicUrl(list.banner), target="_blank"):
genImg(list.banner)
2019-09-20 23:08:30 +00:00
tdiv(class="timeline-header"):
2020-06-01 00:22:22 +00:00
text &"\"{list.name}\" by @{list.username}"
tdiv(class="timeline-description"):
text list.description
2019-09-20 23:08:30 +00:00
2021-10-02 08:13:56 +00:00
renderListTabs(query, &"/i/lists/{list.id}")
2019-09-20 23:08:30 +00:00
body