Commit eb04c4e1 authored by Robin Sonnabend's avatar Robin Sonnabend

Differentiate between done and published

/close #81
parent ab648c82
......@@ -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
......
......@@ -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>
......
......@@ -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():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment