protocols-list.html 1.05 KB
Newer Older
1
{% extends "layout.html" %}
Robin Sonnabend's avatar
Robin Sonnabend committed
2
{% from "macros.html" import render_table, render_form %}
3
4
{% block title %}Protokolle{% endblock %}

Robin Sonnabend's avatar
Robin Sonnabend committed
5
{% macro page_link(page, text) %}
Robin Sonnabend's avatar
Robin Sonnabend committed
6
    <a href="{{url_for(request.endpoint, page=page, protocoltype=protocoltype_id, search=search_term, open=open)}}">{{text}}</a>
Robin Sonnabend's avatar
Robin Sonnabend committed
7
8
{% endmacro %}

9
10
{% block content %}
<div class="container">
Robin Sonnabend's avatar
Robin Sonnabend committed
11
    {{render_form(search_form, class_="form-inline", action_url=url_for("list_protocols"), action_text="Suchen", labels_visible=False, method="GET")}}
12
    {{render_table(protocols_table)}}
Robin Sonnabend's avatar
Robin Sonnabend committed
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
    <div class="centered">
        {% if page > page_diff %}
            {{page_link(0, "<<")}}
        {% endif %}
        {% for p in range(max(0, page - page_diff), min(page_count, page + page_diff + 1)) %}
            {% if p != page %}
                {{page_link(p, p + 1)}}
            {% else %}
                Seite {{p + 1}}
            {% endif %}
        {% endfor %}
        {% if page < page_count - page_diff - 1 %}
            {{page_link(page_count - 1, ">>")}}
        {% endif %}
    </div>
28
29
</div>
{% endblock %}