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

Better looking next/previous arrows

parent 88be719a
No related branches found
No related tags found
No related merge requests found
......@@ -149,7 +149,8 @@ def topic_show():
form.topic.data = topic.id
statements = topic.sorted_statements()
topics = topic.event.sorted_topics()
return render_layout("admin_topic_show.html", topic=topic, form=form, statements=statements, topics=topics)
can_undo = len(Statement.query.filter_by(executed=True, topic_id=topic_id).order_by(db.desc(Statement.execution_time)).all()) > 0
return render_layout("admin_topic_show.html", topic=topic, form=form, statements=statements, topics=topics, can_undo_statement=can_undo)
return redirect(url_for(".index"))
......
......@@ -66,12 +66,22 @@
{{ render_form(form, action_url=url_for(".statement_new"), action_text="Add", title="Add Statement", class_="mdl-card mdl-shadow--2dp mdl-cell mdl-cell--12-col mdl-cell--8-col-tablet mdl-cell--4-col-phone", btn_list=[("","Add Statement","add_statement"), ("mdl-button--colored","Add Meta","add_meta_statement")] ) }}
<div class="mdl-cell mdl-card mdl-shadow--2dp mdl-cell--12-col mdl-cell--8-col-tablet mdl-cell--4-col-phone">
<ul class="rede-list-no-bullet">
{% if topic.sorted_statements()|length() > 0 %}
<li>
<a id="next-statement-button" href="{{ url_for(".statement_done", id=topic.sorted_statements()[0].id, topic_id=topic.id) }}" class="rede-href"><i class="material-icons" role="presentation">redo</i> Next</a>
</li>
<table style="width: 100%">
<tr>
<td>
{% if can_undo_statement %}
<a href="{{ url_for(".statement_undo", topic_id=topic.id) }}" class="rede-href"><i class="material-icons" role="presentation">undo</i> Previous</a>
{% endif %}
<li><a href="{{ url_for(".statement_undo", topic_id=topic.id) }}" class="rede-href"><i class="material-icons" role="presentation">undo</i> Previous</a></li>
</td>
<td>
{% if topic.sorted_statements()|length() > 0 %}
<a id="next-statement-button" href="{{ url_for(".statement_done", id=topic.sorted_statements()[0].id, topic_id=topic.id) }}" class="rede-href">Next <i class="material-icons" role="presentation">redo</i></a>
{% endif %}
</td>
<tr>
</table>
</li>
<li>
<form action="{{ url_for(".pause", id=topic.event.id, original=topic.id) }}" method="POST">
<button class="mdl-button">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment