summaryrefslogtreecommitdiff
path: root/search/templates/search/search.html
blob: 22c2a852950c2c784987a7abfc7fe444aed7e730 (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
{% 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  %}" class="btn btn-primary btn-sm">Read Post &rarr;</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><br><a href="{{ request.META.HTTP_REFERER }}" class="btn btn-primary btn-sm">&larr; Return to previous page</a></p>
    </div>
    {# Sidebar Widgets Column #}
    <div class="col-md-4">
      {% include "search.html" %}
    </div>
  </div>
</div>
{% endblock %}