mirror of
https://github.com/zedeus/nitter
synced 2026-09-25 23:09:20 +00:00
Rearchitect profile, support pins, Profile -> User
This commit is contained in:
parent
79b98a8081
commit
51ae076ea0
23 changed files with 375 additions and 286 deletions
|
|
@ -1,5 +1,5 @@
|
|||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
import strutils, strformat, sequtils, unicode, tables
|
||||
import strutils, strformat, sequtils, unicode, tables, options
|
||||
import karax/[karaxdsl, vdom]
|
||||
|
||||
import renderutils, timeline
|
||||
|
|
@ -88,7 +88,8 @@ proc renderSearchPanel*(query: Query): VNode =
|
|||
span(class="search-title"): text "Near"
|
||||
genInput("near", "", query.near, placeholder="Location...")
|
||||
|
||||
proc renderTweetSearch*(results: Result[Tweet]; prefs: Prefs; path: string): VNode =
|
||||
proc renderTweetSearch*(results: Result[Tweet]; prefs: Prefs; path: string;
|
||||
pinned=none(Tweet)): VNode =
|
||||
let query = results.query
|
||||
buildHtml(tdiv(class="timeline-container")):
|
||||
if query.fromUser.len > 1:
|
||||
|
|
@ -105,9 +106,9 @@ proc renderTweetSearch*(results: Result[Tweet]; prefs: Prefs; path: string): VNo
|
|||
if query.fromUser.len == 0:
|
||||
renderSearchTabs(query)
|
||||
|
||||
renderTimelineTweets(results, prefs, path)
|
||||
renderTimelineTweets(results, prefs, path, pinned)
|
||||
|
||||
proc renderUserSearch*(results: Result[Profile]; prefs: Prefs): VNode =
|
||||
proc renderUserSearch*(results: Result[User]; prefs: Prefs): VNode =
|
||||
buildHtml(tdiv(class="timeline-container")):
|
||||
tdiv(class="timeline-header"):
|
||||
form(`method`="get", action="/search", class="search-field"):
|
||||
|
|
|
|||
Loading…
Reference in a new issue