summaryrefslogtreecommitdiff
path: root/templates/search.html
blob: 81a10073221789cb6d8a01b7f3d532fef8636b18 (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
{% extends "_base.html" %}
{% block title %}
    {% if term != "" %}
        {{ term }}
    {% else %}
        Start a new Search
    {% endif %}
{% endblock %}
{% block searchValue %}{{ term }}{% endblock %}
{% block content %}
    {% if matches %}
        {# Result rendering #}
        Matched {{ matches.__len__() }} Book{% if matches.__len__() > 1 %}s{% endif %}
        {% for docnum, matches in matches.items() %}
            <div class="book">
                <a href="{{ url_for("do_book_file", docnum=docnum) }}">book: {{ docnum }}</a>
                <img src="{{ url_for("do_book_frontpage", docnum=docnum) }}"/>
                <br />
                {% for match in matches %}
                    <div class="match">
                        Match at page {{ match[2] }} (
                        <a href="{{ url_for("do_page_image", docnum=match[0]) }}">image</a>,
                        <a href="{{ url_for("do_page_file", docnum=match[0]) }}">pdf</a>)
                        score={{ match[0] }}
                        <a href="{{ url_for("json_excerpt", docnum=match[0], term=term) }}">excerpt</a>
                    </div>
                {% endfor %}
            </div>
            <hr />
        {% endfor %}
    {% endif %}
{% endblock %}