Skip to content
Snippets Groups Projects
Commit d067165e authored by YSelf Tool's avatar YSelf Tool
Browse files

Deduplication

parent 3ec31735
Branches
No related tags found
No related merge requests found
...@@ -67,7 +67,7 @@ def update(): ...@@ -67,7 +67,7 @@ def update():
else: else:
for event in Event.query.all(): for event in Event.query.all():
meta.append((query_statements(mode, event.id), event)) meta.append((query_statements(mode, event.id), event))
return render_template("speech_update_show.html", mode=mode, meta=meta) return render_template("speech_content_show.html", mode=mode, meta=meta)
@speech.route("/add", methods=["GET", "POST"]) @speech.route("/add", methods=["GET", "POST"])
......
...@@ -52,7 +52,7 @@ def update(): ...@@ -52,7 +52,7 @@ def update():
no_speaker = Speaker("No Speaker", event) no_speaker = Speaker("No Speaker", event)
no_statement = Statement(no_speaker, event) no_statement = Statement(no_speaker, event)
meta.append((ls[0] if len(ls) > 0 else (no_statement, no_speaker, ()), event)) meta.append((ls[0] if len(ls) > 0 else (no_statement, no_speaker, ()), event))
return render_template("update_index.html", meta=meta) return render_template("content_index.html", meta=meta)
@app.route("/update.js") @app.route("/update.js")
def update_js(): def update_js():
......
File moved
...@@ -5,35 +5,5 @@ ...@@ -5,35 +5,5 @@
{% endblock %} {% endblock %}
{% block content %} {% block content %}
{% for (statement, speaker, count), event in meta %} {% include "content_index.html" %}
<div class="mdl-color--white mdl-shadow--2dp mdl-cell mdl-cell--4-col mdl-cell--4-col-tablet mdl-cell--4-col-phone mdl-card">
<div class="mdl-card__title">
<h3 class="mdl-card__title-text">{{ event.name }}: {{ speaker.name }}</h3>
</div>
<div class="mdl-card__actions">
{% if current_user.is_authenticated() and "user" in current_user.roles %}
<a href="{{ url_for("speech.index", event=event.id, mode="pending") }}">
<button type="button" class="mdl-button mdl-js-button mdl-button--raised mdl-button--colored">
<i class="material-icons" role="presentation">build</i>
</button>
</a>
{% endif %}
<a href="{{ url_for("speech.show", event=event.id, mode="pending") }}">
<button type="button" class="mdl-button mdl-js-button mdl-button--raised mdl-button--colored">
<i class="material-icons" role="presentation">announcement</i>
</button>
</a>
<a href="{{ url_for("speech.show", event=event.id, mode="all") }}">
<button type="button" class="mdl-button mdl-js-button mdl-button--raised mdl-button--colored">
<i class="material-icons" role="presentation">list</i>
</button>
</a>
<a href="{{ url_for("speech.show", event=event.id, mode="past") }}">
<button type="button" class="mdl-button mdl-js-button mdl-button--raised mdl-button--colored">
<i class="material-icons" role="presentation">schedule</i>
</button>
</a>
</div>
</div>
{% endfor %}
{% endblock %} {% endblock %}
...@@ -6,46 +6,5 @@ ...@@ -6,46 +6,5 @@
{% endblock %} {% endblock %}
{% block content %} {% block content %}
{% for statements, event in meta %} {% include "speech_content_show.html" %}
<table class="mdl-data-table mdl-js-table mdl-shadow--2dp mdl-cell mdl-cell--12-col mdl-cell--8-col-tablet mdl-cell--4-col-phone">
<thead>
<tr>
<th class="mdl-data-table__cell--non-numeric">Speaker for {{ event.name }}</th>
{% if mode == "all" or mode == "past" %}
<th class="mdl-data-table__cell--non-numeric">Time</th>
{% endif %}
</tr>
</thead>
<tbody>
{% if mode == "all" or mode == "past" %}
{% for statement, speaker in statements %}
<tr>
<td class="mdl-data-table__cell--non-numeric">
{{ speaker.name }}
</td>
{% if mode == "all" %}
<td class="mdl-data-table__cell--non-numeric">
{{ statement.insertion_time.strftime("%d. %B %Y, %H:%M") }}
</td>
{% elif mode == "past" %}
<td class="mdl-data-table__cell--non-numeric">
{{ statement.execution_time.strftime("%d. %B %Y, %H:%M") }}
</td>
{% endif %}
</tr>
{% endfor %}
{% elif mode == "pending" %}
{% for statement, speaker, count in statements %}
{% if not statement.executed %}
<tr>
<td class="mdl-data-table__cell--non-numeric">
<h5>{{ speaker.name }}</h5>
</td>
</tr>
{% endif %}
{% endfor %}
{% endif %}
</tbody>
</table>
{% endfor %}
{% endblock %} {% endblock %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment