Add time range to search panel

This commit is contained in:
Zed
2019-09-19 22:11:38 +02:00
parent 70f89a9502
commit 8324508b2c
6 changed files with 72 additions and 13 deletions

View File

@@ -83,3 +83,8 @@ proc genSelect*(pref, label, state: string; options: seq[string]): VNode =
option(value=opt, selected=""): text opt
else:
option(value=opt): text opt
proc genDate*(pref, state: string): VNode =
buildHtml(span):
verbatim &"<input name={pref} type=\"date\" value=\"{state}\"/>"
icon "calendar"

View File

@@ -76,6 +76,12 @@ proc renderSearchPanel*(query: Query): VNode =
else: k in query.excludes
genCheckbox(&"{f[0]}-{k}", v, state)
span(class="search-title"): text "Time range"
tdiv(class="date-range"):
genDate("since", query.since)
span(class="search-title"): text "-"
genDate("until", query.until)
proc renderTweetSearch*(tweets: Result[Tweet]; prefs: Prefs; path: string): VNode =
let query = tweets.query
buildHtml(tdiv(class="timeline-container")):