search.html 1.92 KB
Newer Older
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
{% extends 'layouts/base.html' %}

{% block title %}
GMU Advisor | Search
{% endblock %}

{% block content %}

<div class="page-header" id="banner">
  <div class="row">
    <div class="col-lg-12 text-center">
      <h1>Search</h1>
    </div>
  </div>
</div>

<div class="row">
  <div class="col-lg-8 col-lg-offset-2">
    <form class="form-horizontal" role="form" method="get">
 
        <div class="input-group">
          <span class="input-group-addon">
            <span class="glyphicon glyphicon-search"></span>
          </span>
          {{ form.q }}
        </div>

    </form>
  </div>
</div>

{% if query %}
<hr />

<div class="row">
  <div class="col-lg-8 col-lg-offset-2">

    {% if page.object_list %}
      <h3 class="text-center">Search Results</h3>
      <div class="list-group">
    {% endif %}

    {% for result in page.object_list %}
      <a class="list-group-item" href="{{ result.object.get_absolute_url }}">
        <strong>{{ result.object }}</strong>
      </a>
    {% empty %}
      <h3 class="text-center">No results found.</h3>
    {% endfor %}

    {% if page.object_list %}
      </div>
    {% endif %}

    </div>
  </div>
</div>

<div class="row">
  <div class="col-lg-5 col-lg-offset-3">

    <ul class="pager">

      {% if page.has_previous %}
        <li class="previous">
          <a href="?q={{ query }}&amp;page={{ page.previous_page_number }}">
            &larr; Previous
          </a>
        </li>
      {% else %}
        <li class="previous disabled">
          <a>
            &larr; Previous
          </a>
        </li>
      {% endif %}

      {% if page.has_next %}
        <li class="next">
          <a href="?q={{ query }}&amp;page={{ page.next_page_number }}">
            Next &rarr;
          </a>
        </li>
      {% else %}
        <li class="next disabled">
          <a>
            Next &rarr;
          </a>
        </li>
      {% endif %}

    </ul>

  </div>
</div>
{% endif %}

{% endblock %}