protocol-show.html 9.4 KB
Newer Older
Robin Sonnabend's avatar
Robin Sonnabend committed
1
{% extends "layout.html" %}
Robin Sonnabend's avatar
Robin Sonnabend committed
2
{% from "macros.html" import render_table, render_form, render_likes %}
Robin Sonnabend's avatar
Robin Sonnabend committed
3
4
{% block title %}Protokoll{% endblock %}

Robin Sonnabend's avatar
Robin Sonnabend committed
5
{% set logged_in = check_login() %}
Robin Sonnabend's avatar
Robin Sonnabend committed
6
{% set user = current_user() %}
7
8
9
10
{% set has_public_type_view_right = protocol.protocoltype.has_public_view_right(user) %}
{% set has_public_view_right = protocol.has_public_view_right(user) %}
{% set has_private_view_right = protocol.has_private_view_right(user) %}
{% set has_modify_right = protocol.has_modify_right(user) %}
Robin Sonnabend's avatar
Robin Sonnabend committed
11
{% set has_admin_right = protocol.has_admin_right(user) %}
Robin Sonnabend's avatar
Robin Sonnabend committed
12

Robin Sonnabend's avatar
Robin Sonnabend committed
13
14
{% block content %}
<div class="container">
15
16
17
    {% if has_modify_right %}
        <div class="btn-group">
            {% if has_modify_right %}
18
                {% if config.ETHERPAD_ACTIVE and not protocol.public %}
19
                <a class="btn {% if protocol.source is none %}btn-primary{% else %}btn-default{% endif %}" href="{{url_for("etherpull_protocol", protocol_id=protocol.id)}}">Aus Etherpad</a>
20
                {% endif %}
21
22
23
                {% if protocol.source is not none %}
                    <a class="btn btn-primary" href="{{url_for("get_protocol_source", protocol_id=protocol.id)}}">Quelltext</a>
                {% endif %} 
24
                {% if not protocol.public or has_admin_right %}
25
                    <a class="btn {% if protocol.is_done() %}btn-success{% else %}btn-default{% endif %}" href="{{url_for("update_protocol", protocol_id=protocol.id)}}">Editieren</a>
26
27
                {% endif %}
                {% if not protocol.public %}
28
29
30
                    {% if config.ETHERPAD_ACTIVE %}
                    <a class="btn btn-primary" href="{{url_for("etherpush_protocol", protocol_id=protocol.id)}}"{% if large_time_diff %} onclick="return confirm('Bist du dir sicher, dass du das Template bereits in das Etherpad kopieren willst? Die Sitzung ist erst in {{time_diff.days}} Tagen.');"{% endif %}>Etherpad</a>
                    {% endif %}
31
                {% endif %}
32
33
                {% if not protocol.is_done() %}
                    <a class="btn btn-default" href="{{url_for("get_protocol_template", protocol_id=protocol.id)}}">Vorlage</a>
34
35
36
                    {% if config.MAIL_ACTIVE %}
                        <a class="btn btn-default" href="{{url_for("send_protocol_reminder", protocol_id=protocol.id)}}" onclick="return confirm('Bist du dir sicher, dass du manuell eine Einladung verschicken willst? Dies wird auch automatisch geschehen.');">Einladung versenden</a>
                    {% endif %}
37
38
                {% else %}
                    {% if config.MAIL_ACTIVE %}
39
40
41
42
                        <a class="btn btn-default" href="{{url_for("send_protocol_private", protocol_id=protocol.id)}}">Intern versenden</a>
                        {% if protocol.public %}
                            <a class="btn btn-default" href="{{url_for("send_protocol_public", protocol_id=protocol.id)}}">Öffentlich versenden</a>
                        {% endif %}
43
44
45
46
                    {% endif %}
                    {% if not protocol.public %}
                        <a class="btn btn-default" href="{{url_for("publish_protocol", protocol_id=protocol.id)}}">Veröffentlichen</a>
                    {% endif %}
47
                {% endif %}
Robin Sonnabend's avatar
Robin Sonnabend committed
48
                <a class="btn btn-default" href="{{url_for("show_type", protocoltype_id=protocol.protocoltype.id)}}">Typ</a>
49
50
51
                {% if protocol.has_compiled_document() %}
                    <a class="btn btn-success" href="{{url_for("download_document", document_id=protocol.get_compiled_document().id)}}">Download</a>
                {% endif %}
52
                {% if has_admin_right %}
53
            <a class="btn btn-default" href="{{url_for("recompile_protocol", protocol_id=protocol.id)}}">Neu kompilieren</a>
54
            <a class="btn btn-danger" href="{{url_for("delete_protocol", protocol_id=protocol.id)}}" onclick="return confirm('Bist du dir sicher, dass du das Protokoll {{protocol.get_short_identifier()}} löschen möchtest?');">Löschen</a>
55
                {% endif %}
Robin Sonnabend's avatar
Robin Sonnabend committed
56
            {% endif %}
57
58
        </div>
    {% endif %}
Robin Sonnabend's avatar
Robin Sonnabend committed
59
60
    <div class="row">
        <div id="left-column" class="col-lg-6">
Robin Sonnabend's avatar
Robin Sonnabend committed
61
            {% if protocol.is_done() %}
Robin Sonnabend's avatar
Robin Sonnabend committed
62
63
64
65
                <h2>
                    Protokoll: {{protocol.protocoltype.name}} {% if protocol.date is not none %}vom {{protocol.date|datify}}{% endif %}
                    {{render_likes(protocol.likes, protocol_id=protocol.id)}}</h2>
                </h2>
Robin Sonnabend's avatar
Robin Sonnabend committed
66
            {% else %}
Robin Sonnabend's avatar
Robin Sonnabend committed
67
68
69
70
                <h2>
                    {{protocol.protocoltype.name}} {% if protocol.date is not none %}am {{protocol.date|datify}}{% endif %}
                    {{render_likes(protocol.likes, protocol_id=protocol.id)}}
                </h2>
Robin Sonnabend's avatar
Robin Sonnabend committed
71
            {% endif %}
Robin Sonnabend's avatar
Robin Sonnabend committed
72
            {% if protocol.is_done() %}
Robin Sonnabend's avatar
Robin Sonnabend committed
73
74
75
76
77
78
                {% if protocol.date is not none %}
                    <p><strong>Datum:</strong> {{protocol.date|datify_long}}</p>
                {% endif %}
                {% if protocol.start_time is not none and protocol.end_time is not none %}
                    <p><strong>Zeit:</strong> von {{protocol.start_time|timify}} bis {{protocol.end_time|timify}}</p>
                {% endif %}
79
80
                {% if has_public_view_right %}
                    {% for meta in protocol.metas %}
81
82
83
                        {% if not meta.internal or has_private_view_right %}
                            <p><strong>{{meta.name}}:</strong> {{meta.value}}</p>
                        {% endif %}
84
                    {% endfor %}
85
                {% endif %}
Robin Sonnabend's avatar
Robin Sonnabend committed
86
            {% else %}
87
                {% if protocol.date is not none %}
88
                    <p><strong>Geplant:</strong> {{protocol.date|datify_long}}, {{protocol.get_time()|timify}}</p>
89
90
91
92
                {% endif %}
                {% for meta in protocol.metas %}
                    <p><strong>{{meta.name}}:</strong> {{meta.value}}</p>
                {% endfor %}
Robin Sonnabend's avatar
Robin Sonnabend committed
93
94
            {% endif %}

Robin Sonnabend's avatar
Robin Sonnabend committed
95
96
            <h3>Tagesordnung{% if has_modify_right and not protocol.has_nonplanned_tops() %} <a href="{{url_for("new_top", protocol_id=protocol.id)}}">Top hinzufügen</a>{% endif %}</h3>
            {% include "protocol-tops-include.html" %}
Robin Sonnabend's avatar
Robin Sonnabend committed
97

98
99
100
101
102
103
104
105
106
            {% if protocol.is_done() %}
                <h3>Beschlüsse</h3>
                <ul>
                    {% if protocol.decisions|length > 0 %}
                        {% if has_public_view_right %}
                            {% for decision in protocol.decisions %}
                                <li>
                                    {{decision.content}}
                                    {% if config.PRINTING_ACTIVE and has_private_view_right and decision.document is not none %}
Robin Sonnabend's avatar
Robin Sonnabend committed
107
                                        <a href="{{url_for("print_decision", decisiondocument_id=decision.document.id)}}">Drucken</a>
108
                                    {% endif %}
Robin Sonnabend's avatar
Robin Sonnabend committed
109
                                    {{render_likes(decision.likes, decision_id=decision.id)}}</h2>
110
111
112
                                </li>
                            {% endfor %}
                        {% else %}
113
114
115
116
117
                            {% if protocol.public %}
								<li>Protokoll und Beschlüsse sind in einem eingeschränkten Netzwerk sichtbar.</li>
							{% else %}
								<li>Das Protokoll ist noch nicht veröffentlicht.</li>
							{% endif %}
118
119
120
121
122
                        {% endif %}
                    {% else %}
                        <li>Keine Beschlüsse</li>
                    {% endif %}
                </ul>
Robin Sonnabend's avatar
Robin Sonnabend committed
123
124
125
            {% endif %}
        </div>
        <div id="right-column" class="col-lg-6">
Robin Sonnabend's avatar
Robin Sonnabend committed
126
            {% if protocol.is_done() and has_public_view_right and logged_in %}
Robin Sonnabend's avatar
Robin Sonnabend committed
127
                <h3>Todos dieser Sitzung <a href="{{url_for("list_todos")}}">Aktuelle Todos</a> <a href="{{url_for("new_todo", protocol_id=protocol.id)}}">Neu</a></h3>
Robin Sonnabend's avatar
Robin Sonnabend committed
128
129
130
                <ul>
                    {% if protocol.get_originating_todos()|length > 0 %}
                        {% for todo in protocol.get_originating_todos() %}
Robin Sonnabend's avatar
Robin Sonnabend committed
131
132
133
134
                            <li>
                                {{todo.render_html()|safe}}
                                {{render_likes(todo.likes, todo_id=todo.id)}}
                            </li>
Robin Sonnabend's avatar
Robin Sonnabend committed
135
136
137
138
139
                        {% endfor %}
                    {% else %}
                        <li>Keine Todos</li>
                    {% endif %}
                </ul>
Robin Sonnabend's avatar
Robin Sonnabend committed
140
            {% endif %}
Robin Sonnabend's avatar
Robin Sonnabend committed
141
            {% if has_modify_right %}
Robin Sonnabend's avatar
Robin Sonnabend committed
142
143
144
                {% if protocol.errors|length > 0 %}
                    {{render_table(errors_table)}}
                {% endif %}
Robin Sonnabend's avatar
Robin Sonnabend committed
145
            {% endif %}
146
            {% if protocol.documents|length > 0 and has_public_view_right %}
147
                {{render_table(documents_table)}}
Robin Sonnabend's avatar
Robin Sonnabend committed
148
            {% else %}
Robin Sonnabend's avatar
Robin Sonnabend committed
149
150
151
                {% if has_modify_right %}
                    <h3>Hochladen</h3>
                {% endif %}
152
            {% endif %}
Robin Sonnabend's avatar
Robin Sonnabend committed
153
            {% if has_modify_right %}
Robin Sonnabend's avatar
Robin Sonnabend committed
154
155
                {{render_form(source_upload_form, action_url=url_for("upload_source_to_known_protocol", protocol_id=protocol.id, next=url_for("show_protocol", protocol_id=protocol.id)), action_text="Hochladen", enctype="multipart/form-data")}}
                {{render_form(document_upload_form, action_url=url_for("upload_document", protocol_id=protocol.id, next=url_for("show_protocol", protocol_id=protocol.id)), action_text="Hochladen", enctype="multipart/form-data")}}
Robin Sonnabend's avatar
Robin Sonnabend committed
156
157
158
            {% endif %}
        </div>
    </div>
159
    {% if content_html is not none and has_public_view_right %}
160
161
162
163
164
        <div>
            <h3>Protokollinhalt</h3>
            {{content_html|safe}}
        </div>
    {% endif %}
Robin Sonnabend's avatar
Robin Sonnabend committed
165
166
</div>
{% endblock %}