diff --git a/mo/db.py b/mo/db.py index 812935da314e920ec120b711bb247ef3f02b8fad..000d01ca6fd196edc465f7d3a1afa00177514c47 100644 --- a/mo/db.py +++ b/mo/db.py @@ -22,7 +22,7 @@ from typing import Optional, List, Tuple import mo from mo.place_level import place_levels, PlaceLevel -from mo.util_format import timedelta, time_and_timedelta +from mo.util_format import timeformat_short, timedelta, time_and_timedelta # HACK: Work-around for https://github.com/dropbox/sqlalchemy-stubs/issues/114 from typing import TYPE_CHECKING, TypeVar, Type, Any @@ -306,6 +306,14 @@ class Round(Base): return round_points_step_names[self.points_step] return str(self.points_step) + def format_times(self) -> str: + times = [] + if self.ct_tasks_start is not None: + times.append('od ' + timeformat_short(self.ct_tasks_start)) + if self.ct_submit_end is not None: + times.append('do ' + timeformat_short(self.ct_submit_end)) + return " ".join(times) + class User(Base): __tablename__ = 'users' diff --git a/mo/web/templates/user_join_list.html b/mo/web/templates/user_join_list.html index 453771ec50e907bed4ce9711567f01d3a46ffd3a..3f7796f59683b234b2c938110ac261f9c1d0db85 100644 --- a/mo/web/templates/user_join_list.html +++ b/mo/web/templates/user_join_list.html @@ -11,6 +11,7 @@ <th>Kategorie <th>Popis <th>Kolo + <th>Termíny <th>Odkazy <tbody> {% for round in available_rounds %} @@ -18,6 +19,7 @@ <td><b>{{ round.category }}</b> <td>{{ round.enroll_advert }}</b> <td>{{ round.name }} + <td>{{ round.format_times() }} {% if round.round_id in pcrs_by_round_id %} <td>Již přihlášen {% else %}