about summary refs log tree commit diff
path: root/templates/search.html
blob: 3bb30e5d60b372b61a0a8f95ae1e7f63f8864ccc (plain) (blame)
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta http-equiv="Content-Security-Policy" content="script-src 'self';">
    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
    <title>Converse Index</title>
  </head>
  <body>
    <header>
      <nav class="navbar navbar-light bg-light justify-content-between mb-3">
        <a class="navbar-brand" href="/">
          <h2>Converse</h2>
        </a>
        <form class="form-inline" method="get" action="/search">
          <input class="form-control mr-sm-2" type="search" placeholder="Search" name="query" aria-label="Search">
          <button class="btn btn-outline-success my-2 my-sm-0 mr-1" type="submit">Search</button>
          <a class="btn btn-outline-secondary my-2" href="/thread/new">New thread</a>
          <a class="btn btn-outline-secondary my-2" href="/">Back to index</a>
        </form>
      </nav>
    </header>
    <div class="container">
      <div class="row">
        <div class="col-4">
          <h2>Search results for '{{ query }}':</h2>
        </div>
      </div>
      <div class="row">
        <div class="col-12">
          <div class="list-group">
            {% for result in results -%}
            <a href="/thread/{{ result.thread_id }}#post-{{ result.post_id }}" class="list-group-item flex-column list-group-item-action align-items-start">
              <div class="d-flex w-100 justify-content-between">
                <h5 class="mb-1">In thread '{{ result.title }}':</h5>
                <div>{{ result.headline }}</div>
                <div>(Posted by <i>{{ result.author }})</i></div>
              </div>
            </a>
            {%- endfor %}
          </div>
        </div>
      </div>
    </div>
  </body>
</html>