Esempio n. 1
0
from oioioi.contests.utils import (can_enter_contest, contest_exists,
                                   has_any_submittable_problem,
                                   has_any_visible_problem_instance,
                                   is_contest_basicadmin)
from oioioi.dashboard.contest_dashboard import register_contest_dashboard_view
from oioioi.dashboard.forms import DashboardMessageForm
from oioioi.dashboard.menu import top_links_registry
from oioioi.dashboard.models import DashboardMessage
from oioioi.dashboard.registry import (dashboard_headers_registry,
                                       dashboard_registry)
from oioioi.questions.views import messages_template_context, visible_messages
from oioioi.rankings.views import has_any_ranking_visible

top_links_registry.register('problems_list', _("Problems"),
        lambda request: reverse('problems_list', kwargs={'contest_id':
            request.contest.id}),
        condition=has_any_visible_problem_instance,
        order=100)

top_links_registry.register('submit', _("Submit"),
        lambda request: reverse('submit', kwargs={'contest_id':
            request.contest.id}),
        condition=has_any_submittable_problem,
        order=200)

top_links_registry.register('ranking', _("Ranking"),
        lambda request: reverse('default_ranking', kwargs={'contest_id':
            request.contest.id}),
        condition=has_any_ranking_visible,
        order=300)
Esempio n. 2
0
from oioioi.contests.utils import can_enter_contest, contest_exists, \
        has_any_submittable_problem, has_any_visible_problem_instance, \
        is_contest_admin
from oioioi.dashboard.contest_dashboard import register_contest_dashboard_view
from oioioi.dashboard.menu import top_links_registry
from oioioi.dashboard.registry import dashboard_registry, \
        dashboard_headers_registry
from oioioi.dashboard.models import DashboardMessage
from oioioi.dashboard.forms import DashboardMessageForm
from oioioi.rankings.views import has_any_ranking_visible
from oioioi.questions.views import messages_template_context, \
        visible_messages

top_links_registry.register('problems_list', _("Problems"),
        lambda request: reverse('problems_list', kwargs={'contest_id':
            request.contest.id}),
        condition=has_any_visible_problem_instance,
        order=100)

top_links_registry.register('submit', _("Submit"),
        lambda request: reverse('submit', kwargs={'contest_id':
            request.contest.id}),
        condition=has_any_submittable_problem,
        order=200)

top_links_registry.register('ranking', _("Ranking"),
        lambda request: reverse('default_ranking', kwargs={'contest_id':
            request.contest.id}),
        condition=has_any_ranking_visible,
        order=300)