protocol-tops-include.html 3.65 KB
Newer Older
Robin Sonnabend's avatar
Robin Sonnabend committed
1
{% from "macros.html" import render_likes %}
Robin Sonnabend's avatar
Robin Sonnabend committed
2
3
4
5
<ul>
    {% if not protocol.has_nonplanned_tops() %}
        {% for default_top in protocol.protocoltype.default_tops %}
            {% if not default_top.is_at_end() %}
6
                {% set localtop = default_top.get_localtop(protocol) %}
7
                <li class="{{localtop.get_css_classes()|join(" ")}}" {% if localtop.is_expandable() %} id="localtop-{{localtop.id}}" title="{{localtop.description}}"{% endif %}>
8
9
10
11
12
13
14
15
16
17
18
                    {{default_top.name}}
                    {% if not protocol.is_done() and has_modify_right %}
                        <a href="{{url_for('edit_localtop', localtop_id=localtop.id)}}">Ändern</a>
                    {% endif %}
                    {% if has_private_view_right and localtop.description is not none and localtop.description|length > 0 %}
                        <span class="glyphicon glyphicon-info-sign"></span>
                        <pre id="localtop-{{localtop.id}}-description" class="expansion-text">
                            {{-localtop.description-}}
                        </pre>
                    {% endif %}
                </li>
Robin Sonnabend's avatar
Robin Sonnabend committed
19
20
21
22
            {% endif %}
        {% endfor %}
    {% endif %}
    {% for top in protocol.tops %}
23
        <li{% if has_private_view_right and top.description is not none %} class="expansion-button" id="top-{{top.id}}" title="{{top.description}}"{% endif %}>
Robin Sonnabend's avatar
Robin Sonnabend committed
24
            {{top.name}}
Robin Sonnabend's avatar
Robin Sonnabend committed
25
            {% if not protocol.is_done() and has_modify_right %}
Robin Sonnabend's avatar
Robin Sonnabend committed
26
27
                ({{top.number}})
            {% endif %}
Robin Sonnabend's avatar
Robin Sonnabend committed
28
            {% if not protocol.is_done() and has_modify_right %}
Robin Sonnabend's avatar
Robin Sonnabend committed
29
                <a href="{{url_for('edit_top', top_id=top.id)}}">Ändern</a>
30
31
32
                <a href="{{url_for('move_top', top_id=top.id, diff=1, csrf_token=get_csrf_token())}}">Runter</a>
                <a href="{{url_for('move_top', top_id=top.id, diff=-1, csrf_token=get_csrf_token())}}">Hoch</a>
                <a href="{{url_for('delete_top', top_id=top.id, csrf_token=get_csrf_token())}}" onclick="return confirm('Bist du dir sicher, dass du den TOP {{top.name}} löschen möchtest?');">Löschen</a>
Robin Sonnabend's avatar
Robin Sonnabend committed
33
            {% endif %}
34
            {% if has_private_view_right and top.description is not none and top.description|length > 0 %}
Robin Sonnabend's avatar
Robin Sonnabend committed
35
36
37
38
39
                <span class="glyphicon glyphicon-info-sign"></span>
                <pre id="top-{{top.id}}-description" class="expansion-text">
                    {{-top.description-}}
                </pre>
            {% endif %}
Robin Sonnabend's avatar
Robin Sonnabend committed
40
            {{render_likes(top.likes, top_id=top.id)}}
Robin Sonnabend's avatar
Robin Sonnabend committed
41
42
43
44
45
        </li>
    {% endfor %}
    {% if not protocol.has_nonplanned_tops() %}
        {% for default_top in protocol.protocoltype.default_tops %}
            {% if default_top.is_at_end() %}
46
                {% set localtop = default_top.get_localtop(protocol) %}
47
                <li class="{{localtop.get_css_classes()|join(" ")}}" {% if localtop.is_expandable() %} id="localtop-{{localtop.id}}" title="{{localtop.description}}"{% endif %}>
48
49
50
51
52
53
54
55
56
57
58
                    {{default_top.name}}
                    {% if not protocol.is_done() and has_modify_right %}
                        <a href="{{url_for('edit_localtop', localtop_id=localtop.id)}}">Ändern</a>
                    {% endif %}
                    {% if has_private_view_right and localtop.description is not none and localtop.description|length > 0 %}
                        <span class="glyphicon glyphicon-info-sign"></span>
                        <pre id="localtop-{{localtop.id}}-description" class="expansion-text">
                            {{-localtop.description-}}
                        </pre>
                    {% endif %}
                </li>
Robin Sonnabend's avatar
Robin Sonnabend committed
59
60
61
62
            {% endif %}
        {% endfor %}
    {% endif %}
</ul>