decisions-list.html 1.08 KB
Newer Older
Robin Sonnabend's avatar
Robin Sonnabend committed
1
2
3
4
5
{% extends "layout.html" %}
{% from "macros.html" import render_table, render_form %}
{% block title %}Beschlüsse{% endblock %}

{% 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, decisioncategory_id=decisioncategory_id)}}">{{text}}</a>
Robin Sonnabend's avatar
Robin Sonnabend committed
7
8
9
10
11
12
13
14
15
16
{% endmacro %}

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