summaryrefslogtreecommitdiff
path: root/templates/search.html
blob: e2773aeb7b88e39e5f4dc8045eb8a43c70a08efb (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{% extends "_base.html" %}
{% block title %}
    {% if term != "" %}
        {{ term }}
    {% else %}
        Start a new Search
    {% endif %}
{% endblock %}
{% block searchValue %}{{ term }}{% endblock %}
{% block content %}
        {% if match_groups.__len__() == 0 %}
            No Matches
        {% else %}
            {{ resultlen }} Matches in {{ match_groups.__len__() }} files
            {% for match_group in match_groups %}
                <hr />
                <h2>
                    {{ match_group['title'] }} - {{ match_group['filename'] }}
                    (<a href="{{ url_for("do_download_file", docnum=match_group['first_docnum']) }}">
                        Download
                    </a>)
                </h2>
                {% for match in match_group['matches'] %}
                    <h3>
                        Page {{ match['pagenumber'] }}
                        (<a href="{{ url_for("do_download_page", docnum=match_group['first_docnum'], page=match['pagenumber']) }}">Download</a>)
                    </h3>
                    {% autoescape false %}
                        <div>{{ match['excerpt'] }}</div>
                    {% endautoescape %}
                {% endfor %}
            {% endfor %}
        {% endif %}

        <div id="navigation">
            {% if term != "" %}
                {% if skip > 0 %}
                    <a href="{{ url_for("do_search", term=term, skip=skip-5) }}">Previous 5</a>
                {% else %}
                    Previous 5
                {% endif %}
                 - 
                <a href="{{ url_for("do_search", term=term, skip=skip+5) }}">Next 5</a>
            {% endif %}
        </div>
{% endblock %}