diff --git a/mo/web/org_round.py b/mo/web/org_round.py index 7fc300ec3e976c6fcb7e0cfb27af061674a8666e..580098726deecb0484f795ae9c832ce97774409d 100644 --- a/mo/web/org_round.py +++ b/mo/web/org_round.py @@ -55,7 +55,15 @@ def org_rounds(): 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) - 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): diff --git a/mo/web/templates/org_rounds.html b/mo/web/templates/org_rounds.html index fd336634167c91193585aa49edd2a173495440df..d4b415dc7e863a0df32fd04f885522194ae67780 100644 --- a/mo/web/templates/org_rounds.html +++ b/mo/web/templates/org_rounds.html @@ -23,4 +23,10 @@ <td class='rstate-{{r.state.name}}'>{{ r.state.friendly_name() }} {% endfor %} </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 %}