Add location field to search panel

This commit is contained in:
Zed
2019-09-19 23:36:21 +02:00
parent 8324508b2c
commit 62df60be78
7 changed files with 73 additions and 22 deletions

View File

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

View File

@@ -76,11 +76,16 @@ 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)
tdiv(class="search-row"):
tdiv:
span(class="search-title"): text "Time range"
tdiv(class="date-range"):
genDate("since", query.since)
span(class="search-title"): text "-"
genDate("until", query.until)
tdiv:
span(class="search-title"): text "Near"
genInput("near", "", query.near, placeholder="Location...")
proc renderTweetSearch*(tweets: Result[Tweet]; prefs: Prefs; path: string): VNode =
let query = tweets.query