summaryrefslogtreecommitdiff
path: root/search/templates/search/search.html
blob: e91c0d8506ccb29361094c9f3ac899b903329ace (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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
{% extends "base.html" %}
{% load static wagtailcore_tags %}

{% block body_class %}template-searchresults{% endblock %}

{% block title %}Search{% endblock %}

{% block content %}
<div class="container">

    <div class="row">

      <!-- Blog Entries Column -->
      <div class="col-md-8">

      {% if search_results %}
        <h1 class="my-4">Showing search results for "{{ search_query }}"</h1>
        {% for result in search_results %}
        {% with post=result.specific %}
              <!-- Blog Post -->
              <div class="card mb-4">
                <div class="card-body">
                  <h2 class="card-title">{{ post.title }}</h2>
                  <p class="card-text">{{ post.intro }}</p>
                  <a href="{% pageurl post %}">Read Post</a>
                </div>
                <div class="card-footer text-muted">
                  Posted on {{ post.date }}
                </div>
              </div>
      {% endwith %}
      {% endfor %}
      {% elif search_query %}
      <h1 class="my-4">No results found</h1>
      {% endif %}
      <!-- end of results -->
      <p><a href="{{ request.META.HTTP_REFERER }}">Return to previous page</a></p>
      </div>
      <!-- Sidebar Widgets Column -->
      <div class="col-md-4">
        {% include "search.html" %}
      </div>


    <!--
    {% if search_results %}
        <ul>
            {% for result in search_results %}
                <li>
                    <h4><a href="{% pageurl result %}">{{ result }}</a></h4>
                    {% if result.search_description %}
                        {{ result.search_description }}
                    {% endif %}
                </li>
            {% endfor %}
        </ul>

        {% if search_results.has_previous %}
            <a href="{% url 'search' %}?query={{ search_query|urlencode }}&amp;page={{ search_results.previous_page_number }}">Previous</a>
        {% endif %}

        {% if search_results.has_next %}
            <a href="{% url 'search' %}?query={{ search_query|urlencode }}&amp;page={{ search_results.next_page_number }}">Next</a>
        {% endif %}
    {% elif search_query %}
        No results found
    {% endif %} -->
</div>
</div>
</div>
{% endblock %}