diff options
Diffstat (limited to 'src/views/sub-search.pug')
-rw-r--r-- | src/views/sub-search.pug | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/views/sub-search.pug b/src/views/sub-search.pug index f2402f7..cb8eeef 100644 --- a/src/views/sub-search.pug +++ b/src/views/sub-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") |
@@ -13,6 +15,8 @@ html | |||
13 | form(action="/sub-search" method="get").search-bar | 15 | form(action="/sub-search" method="get").search-bar |
14 | - var prefill = original_query ?? ""; | 16 | - var prefill = original_query ?? ""; |
15 | input(type="text" name="q" placeholder="type in a search term..." value=prefill required).search-input | 17 | input(type="text" name="q" placeholder="type in a search term..." value=prefill required).search-input |
18 | input(type="hidden" name="sort" value=sortQuery) | ||
19 | input(type="hidden" name="view" value=viewQuery) | ||
16 | button(type="submit").search-button go | 20 | button(type="submit").search-button go |
17 | if message | 21 | if message |
18 | div.search-message | 22 | div.search-message |
@@ -25,7 +29,7 @@ html | |||
25 | - var isSubbed = subs.includes(subreddit) | 29 | - var isSubbed = subs.includes(subreddit) |
26 | div.sub-title | 30 | div.sub-title |
27 | h3 | 31 | h3 |
28 | a(href=`/r/${subreddit}`) | 32 | a(href=`/r/${subreddit}?sort=${sortQuery}&view=${viewQuery}`) |
29 | | r/#{subreddit} | 33 | | r/#{subreddit} |
30 | div#button-container | 34 | div#button-container |
31 | if isSubbed | 35 | if isSubbed |