From 53c6247d8b2c3bc5f7affc4f5af9e438cd569c0e Mon Sep 17 00:00:00 2001 From: Zed Date: Thu, 19 Sep 2019 01:11:35 +0200 Subject: [PATCH] Fix wrong search links --- src/query.nim | 4 +++- src/views/renderutils.nim | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/query.nim b/src/query.nim index a9fc972..1227da3 100644 --- a/src/query.nim +++ b/src/query.nim @@ -26,11 +26,13 @@ proc initQuery*(pms: Table[string, string]; name=""): Query = result = Query( kind: parseEnum[QueryKind](@"kind", custom), text: @"text", - fromUser: @[name], filters: validFilters.filterIt("f-" & it in pms), excludes: validFilters.filterIt("e-" & it in pms), ) + if name.len > 0: + result.fromUser = name.split(",") + if @"e-nativeretweets".len == 0: result.includes.add "nativeretweets" diff --git a/src/views/renderutils.nim b/src/views/renderutils.nim index 7cc7692..8298d6d 100644 --- a/src/views/renderutils.nim +++ b/src/views/renderutils.nim @@ -60,10 +60,10 @@ proc buttonReferer*(action, text, path: string; class=""; `method`="post"): VNod proc genCheckbox*(pref, label: string; state: bool): VNode = buildHtml(label(class="pref-group checkbox-container")): - text label - if state: input(name=pref, `type`="checkbox", checked="") - else: input(name=pref, `type`="checkbox") - span(class="checkbox") + text label + if state: input(name=pref, `type`="checkbox", checked="") + else: input(name=pref, `type`="checkbox") + span(class="checkbox") proc genInput*(pref, label, state, placeholder: string; class=""): VNode = let s = xmltree.escape(state)