Skip to content
Snippets Groups Projects
Commit a8607ef8 authored by Robin Sonnabend's avatar Robin Sonnabend
Browse files

Show warning on push to etherpad

If the protocol is not on the same day, show a warning before pushing
the template to the etherpad. #44
parent 953f04fe
Branches
No related tags found
No related merge requests found
......@@ -475,7 +475,10 @@ def show_protocol(protocol):
documents_table = DocumentsTable(visible_documents)
document_upload_form = DocumentUploadForm()
source_upload_form = KnownProtocolSourceUploadForm()
return render_template("protocol-show.html", protocol=protocol, errors_table=errors_table, documents_table=documents_table, document_upload_form=document_upload_form, source_upload_form=source_upload_form)
time_diff = protocol.date - datetime.now().date()
print(time_diff)
large_time_diff = not protocol.is_done() and time_diff.days > 0
return render_template("protocol-show.html", protocol=protocol, errors_table=errors_table, documents_table=documents_table, document_upload_form=document_upload_form, source_upload_form=source_upload_form, time_diff=time_diff, large_time_diff=large_time_diff)
@app.route("/protocol/delete/<int:protocol_id>")
@login_required
......
......@@ -23,7 +23,7 @@
{% endif %}
<a class="btn {% if protocol.is_done() %}btn-success{% else %}btn-default{% endif %}" href="{{url_for("update_protocol", protocol_id=protocol.id)}}">Editieren</a>
{% if config.ETHERPAD_ACTIVE %}
<a class="btn btn-primary" href="{{url_for("etherpush_protocol", protocol_id=protocol.id)}}">Etherpad</a>
<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 %}
{% if not protocol.is_done() %}
<a class="btn btn-default" href="{{url_for("get_protocol_template", protocol_id=protocol.id)}}">Vorlage</a>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment