diff --git a/server.py b/server.py index d88888105250dbc33c3028962d75d948fb28bb39..5478887de05428554d267b5a78cdcc7abc8c9dc0 100755 --- a/server.py +++ b/server.py @@ -156,15 +156,16 @@ def index(): finished_protocols = sorted( [ protocol for protocol in protocols - if protocol.done - and (protocol.has_public_view_right(user) - or protocol.has_private_view_right(user)) - and protocol.protocoltype.has_public_view_right(user) + if protocol.done and protocol.public + and (protocol.has_private_view_right(user) + or protocol.protocoltype.has_public_view_right(user, check_networks=False)) ], key=_protocol_sort_key, reverse=True ) protocol = finished_protocols[0] if len(finished_protocols) > 0 else None + show_private = protocol.has_private_view_right(user) + has_public_view_right = protocol.protocoltype.has_public_view_right(user) todos = None if check_login(): todos = [ @@ -177,7 +178,7 @@ def index(): return protocol.date if protocol is not None and protocol.date is not None else datetime.now().date() todos = sorted(todos, key=_todo_sort_key, reverse=True) todos_table = TodosTable(todos) if todos is not None else None - return render_template("index.html", open_protocols=open_protocols, protocol=protocol, todos=todos) + return render_template("index.html", open_protocols=open_protocols, protocol=protocol, todos=todos, show_private=show_private, has_public_view_right=has_public_view_right) @app.route("/documentation") @login_required diff --git a/templates/index.html b/templates/index.html index 7cae3776eeaedfbf8e58d11e476f0006f5753370..96eb310381d8dfd72cab5bce3a85e11a272817cb 100644 --- a/templates/index.html +++ b/templates/index.html @@ -41,19 +41,25 @@ <p><strong>Zeit:</strong> von {{protocol.start_time|timify}} bis {{protocol.end_time|timify}}</p> {% endif %} {% for meta in protocol.metas %} - <p><strong>{{meta.name}}:</strong> {{meta.value}}</p> + {% if not meta.internal or show_private %} + <p><strong>{{meta.name}}:</strong> {{meta.value}}</p> + {% endif %} {% endfor %} <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" %} <h3>Beschlüsse</h3> <ul> - {% if protocol.decisions|length > 0 %} - {% for decision in protocol.decisions %} - <li>{{decision.content}}</li> - {% endfor %} + {% if has_public_view_right %} + {% if protocol.decisions|length > 0 %} + {% for decision in protocol.decisions %} + <li>{{decision.content}}</li> + {% endfor %} + {% else %} + <li>Keine Beschlüsse</li> + {% endif %} {% else %} - <li>Keine Beschlüsse</li> + <li>Protokoll und Beschlüsse sind in eine eingeschränkten Netzwerk erreichbar.</li> {% endif %} </ul> </div> diff --git a/views/tables.py b/views/tables.py index e612dd9df7d5942a6041c26ad1a56b561e87a9ed..209531cf80484e13b3585c4a160fb00463b58ce0 100644 --- a/views/tables.py +++ b/views/tables.py @@ -90,7 +90,12 @@ class ProtocolsTable(Table): date_filter(protocol.date), ] if self.search_results is None: - result.append("Fertig" if protocol.is_done() else "Geplant") + state = "Geplant" + if protocol.is_done(): + state = "Fertig" + if protocol.public: + state = "Veröffentlicht" + result.append(state) elif protocol in self.search_results: result.append(Markup(self.search_results[protocol])) if check_login():