aboutsummaryrefslogtreecommitdiff
path: root/src/views/post-search.pug
blob: 8f93798f4d42c6b6ca69636e631c6c3ca4d0ebcd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
include ../mixins/post
include ../mixins/header
include ../mixins/head

- var viewQuery = query && query.view ? query.view : 'compact'
- var sortQuery = query && query.sort ? query.sort + (query.t ? '&t=' + query.t : '') : 'hot'
doctype html
html
  +head("search posts")
  include ../mixins/subUtils
  body
    main#content
      +header(user)
      div.hero
        h1 search posts
        form(action="/post-search" method="get").search-bar
          - var prefill = original_query ?? "";
          input(type="text" name="q" placeholder="type in a search term..." value=prefill required).search-input
          input(type="hidden" name="sort" value=sortQuery)
          input(type="hidden" name="view" value=viewQuery)
          button(type="submit").search-button go
        if message
          div.search-message
            i #{message}
      if items
        each item in items
          +post(item.data, currentUrl)