Commit 8f882ac0 authored by Robin Sonnabend's avatar Robin Sonnabend
Browse files

Better looking next/previous arrows

parent 88be719a
...@@ -149,7 +149,8 @@ def topic_show(): ...@@ -149,7 +149,8 @@ def topic_show():
form.topic.data = topic.id form.topic.data = topic.id
statements = topic.sorted_statements() statements = topic.sorted_statements()
topics = topic.event.sorted_topics() 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")) return redirect(url_for(".index"))
......
...@@ -66,12 +66,22 @@ ...@@ -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")] ) }} {{ 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"> <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"> <ul class="rede-list-no-bullet">
{% if topic.sorted_statements()|length() > 0 %}
<li> <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> <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 %}
</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>
{% 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>
<li> <li>
<form action="{{ url_for(".pause", id=topic.event.id, original=topic.id) }}" method="POST"> <form action="{{ url_for(".pause", id=topic.event.id, original=topic.id) }}" method="POST">
<button class="mdl-button"> <button class="mdl-button">
...@@ -133,16 +143,16 @@ ...@@ -133,16 +143,16 @@
{% endfor %} {% endfor %}
</table> </table>
<table style="width:100%" > <table style="width:100%" >
<tr> <tr>
<td> <td>
<a href="{{ url_for(".topic_show", id=topic.get_previous_index()) }}"><i class="material-icons" style="heigth: 16pt; width:16pt;">arrow_backward</i>Previous</a> <a href="{{ url_for(".topic_show", id=topic.get_previous_index()) }}"><i class="material-icons" style="heigth: 16pt; width:16pt;">arrow_backward</i>Previous</a>
</td> </td>
<td> <td>
<a href="{{ url_for(".topic_show", id=topic.get_next_index()) }}"> Next <i class="material-icons" style="height:16pt; width:16pt;">arrow_forward</i></a> <a href="{{ url_for(".topic_show", id=topic.get_next_index()) }}"> Next <i class="material-icons" style="height:16pt; width:16pt;">arrow_forward</i></a>
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
</div> </div>
{% if topic.event.paused %} {% if topic.event.paused %}
<div class="mdl-cell mdl-cell--12-col mdl-cell--8-col-tablet mdl-cell--4-col-phone mdl-card mdl-shadow--2dp"> <div class="mdl-cell mdl-cell--12-col mdl-cell--8-col-tablet mdl-cell--4-col-phone mdl-card mdl-shadow--2dp">
......
Supports Markdown
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