diff options
Diffstat (limited to 'src/views/search.pug')
-rw-r--r-- | src/views/search.pug | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/views/search.pug b/src/views/search.pug index ef9b53e..4dc5c0c 100644 --- a/src/views/search.pug +++ b/src/views/search.pug | |||
@@ -1,6 +1,8 @@ | |||
1 | include ../mixins/header | 1 | include ../mixins/header |
2 | include ../mixins/head | 2 | include ../mixins/head |
3 | 3 | ||
4 | - var viewQuery = query && query.view ? query.view : 'compact' | ||
5 | - var sortQuery = query && query.sort ? query.sort + (query.t ? '&t=' + query.t : '') : 'hot' | ||
4 | doctype html | 6 | doctype html |
5 | html | 7 | html |
6 | +head("search subreddits") | 8 | +head("search subreddits") |
@@ -14,6 +16,8 @@ html | |||
14 | form(action="/sub-search" method="get").search-bar | 16 | form(action="/sub-search" method="get").search-bar |
15 | - var prefill = original_query ?? ""; | 17 | - var prefill = original_query ?? ""; |
16 | input(type="text" name="q" placeholder="type in a search term..." value=prefill required).search-input | 18 | input(type="text" name="q" placeholder="type in a search term..." value=prefill required).search-input |
19 | input(type="hidden" name="sort" value=sortQuery) | ||
20 | input(type="hidden" name="view" value=viewQuery) | ||
17 | button(type="submit").search-button go | 21 | button(type="submit").search-button go |
18 | 22 | ||
19 | hr | 23 | hr |
@@ -23,6 +27,8 @@ html | |||
23 | form(action="/post-search" method="get").search-bar | 27 | form(action="/post-search" method="get").search-bar |
24 | - var prefill = original_query ?? ""; | 28 | - var prefill = original_query ?? ""; |
25 | input(type="text" name="q" placeholder="type in a search term..." value=prefill required).search-input | 29 | input(type="text" name="q" placeholder="type in a search term..." value=prefill required).search-input |
30 | input(type="hidden" name="sort" value=sortQuery) | ||
31 | input(type="hidden" name="view" value=viewQuery) | ||
26 | button(type="submit").search-button go | 32 | button(type="submit").search-button go |
27 | p | 33 | p |
28 | | you can narrow search results using filters: | 34 | | you can narrow search results using filters: |