Skip to content
Snippets Groups Projects
Commit 245e6be8 authored by Martin Mareš's avatar Martin Mareš
Browse files

Samostatná stránka na přehled kol všech ročníků

Na /org/contest/ ukazujeme jen aktuální ročník.
parent 1bb8d759
No related branches found
No related tags found
1 merge request!86Registrace
...@@ -55,7 +55,15 @@ def org_rounds(): ...@@ -55,7 +55,15 @@ def org_rounds():
sess = db.get_session() sess = db.get_session()
rounds = sess.query(db.Round).filter_by(year=mo.current_year).order_by(db.Round.year, db.Round.category, db.Round.seq, db.Round.part) rounds = sess.query(db.Round).filter_by(year=mo.current_year).order_by(db.Round.year, db.Round.category, db.Round.seq, db.Round.part)
return render_template('org_rounds.html', rounds=rounds) return render_template('org_rounds.html', rounds=rounds, history=False)
@app.route('/org/contest/history')
def org_rounds_history():
sess = db.get_session()
rounds = sess.query(db.Round).order_by(db.Round.year.desc(), db.Round.category, db.Round.seq, db.Round.part)
return render_template('org_rounds.html', rounds=rounds, history=True)
class TaskDeleteForm(FlaskForm): class TaskDeleteForm(FlaskForm):
......
...@@ -23,4 +23,10 @@ ...@@ -23,4 +23,10 @@
<td class='rstate-{{r.state.name}}'>{{ r.state.friendly_name() }} <td class='rstate-{{r.state.name}}'>{{ r.state.friendly_name() }}
{% endfor %} {% endfor %}
</table> </table>
{% if history %}
<p><a class='btn btn-default' href='{{ url_for('org_rounds') }}'>Aktuální ročník</a>
{% else %}
<p><a class='btn btn-default' href='{{ url_for('org_rounds_history') }}'>Všechny ročníky</a>
{% endif %}
{% endblock %} {% endblock %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment