diff --git a/mo/db.py b/mo/db.py index 47eb48a0b8d4acbaff68c434436f4dc1f8e15905..effab7a0ae67aed291a203ea5fd1f2a807485c9d 100644 --- a/mo/db.py +++ b/mo/db.py @@ -86,8 +86,6 @@ place_type_names_and_levels = { PlaceType.site: ('Soutěžní místo', [4]), } -place_level_names = ['stát', 'kraj', 'okres', 'obec', 'škola'] - class Place(Base): __tablename__ = 'places' diff --git a/mo/place_level.py b/mo/place_level.py index 8ecc2ab4c58d1526b698426f7be98544e2c002f5..2c4f631d43db5c584c18fb021f22073dbef96ab5 100644 --- a/mo/place_level.py +++ b/mo/place_level.py @@ -25,7 +25,7 @@ class PlaceLevel: def in_name(self) -> str: return self.in_prep + ' ' + self.name_loc - + place_levels = [ PlaceLevel(level=0, genus='m', in_prep='ve', diff --git a/mo/web/org_round.py b/mo/web/org_round.py index a2abf38e79bf30f5caf53af83213875fa5882e08..dc2f20c2cb6e6217f213752131fce3912a9200e9 100644 --- a/mo/web/org_round.py +++ b/mo/web/org_round.py @@ -55,7 +55,7 @@ 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, level_names=mo.db.place_level_names) + return render_template('org_rounds.html', rounds=rounds) class TaskDeleteForm(FlaskForm): @@ -228,7 +228,6 @@ def org_round(id: int): contests_counts=contests_counts, tasks=tasks, form_delete_task=form_delete_task, form_add_contest=form_add_contest, - level_names=mo.db.place_level_names, can_manage_round=can_manage_round, can_manage_contestants=can_manage_contestants, can_handle_submits=rr.have_right(Right.view_submits), diff --git a/mo/web/templates/org_round.html b/mo/web/templates/org_round.html index 5cf1afca8e54a3f85352babde3709708ba6eed24..ad46f86396716815e4d51102fa4cd98f6180e721 100644 --- a/mo/web/templates/org_round.html +++ b/mo/web/templates/org_round.html @@ -16,7 +16,7 @@ <tr><td>Kategorie<td>{{ round.category }} <tr><td>Pořadí<td>{{ round.seq }} {% if round.part > 0 %}<tr><td>Část<td>{{ round.part_code() }}{% endif %} - <tr><td>Oblast<td>{{ level_names[round.level] }} + <tr><td>Oblast<td>{{ round.get_level().name }} <tr><td>Vaše role<td>{% if g.user.is_admin %}správce{% elif roles %}{{ roles|join(", ") }}{% else %}–{% endif %} {% if group_rounds|length > 1 %} <tr><td>Skupina kol:<td> diff --git a/mo/web/templates/org_rounds.html b/mo/web/templates/org_rounds.html index 27e362aff57d83492a95a73d16923796199229b6..fd336634167c91193585aa49edd2a173495440df 100644 --- a/mo/web/templates/org_rounds.html +++ b/mo/web/templates/org_rounds.html @@ -18,7 +18,7 @@ <td>{{ r.year }} <td>{{ r.category }} <td>{{ r.seq }}{{ r.part_code() }} - <td>{{ level_names[r.level] }} + <td>{{ r.get_level().name }} <td>{{ r.name }} <td class='rstate-{{r.state.name}}'>{{ r.state.friendly_name() }} {% endfor %}