Rewrite contest UI
This commit is contained in:
parent
6c9551e089
commit
756023a097
20 changed files with 191 additions and 254 deletions
|
@ -988,7 +988,7 @@ def contest_ranking_ajax(request, contest, participation=None):
|
|||
|
||||
class ContestRankingBase(ContestMixin, TitleMixin, DetailView):
|
||||
template_name = "contest/ranking.html"
|
||||
tab = None
|
||||
page_type = None
|
||||
|
||||
def get_title(self):
|
||||
raise NotImplementedError()
|
||||
|
@ -1008,12 +1008,12 @@ class ContestRankingBase(ContestMixin, TitleMixin, DetailView):
|
|||
users, problems = self.get_ranking_list()
|
||||
context["users"] = users
|
||||
context["problems"] = problems
|
||||
context["tab"] = self.tab
|
||||
context["page_type"] = self.page_type
|
||||
return context
|
||||
|
||||
|
||||
class ContestRanking(ContestRankingBase):
|
||||
tab = "ranking"
|
||||
page_type = "ranking"
|
||||
|
||||
def get_title(self):
|
||||
return _("%s Rankings") % self.object.name
|
||||
|
@ -1039,7 +1039,7 @@ class ContestRanking(ContestRankingBase):
|
|||
|
||||
|
||||
class ContestParticipationList(LoginRequiredMixin, ContestRankingBase):
|
||||
tab = "participation"
|
||||
page_type = "participation"
|
||||
|
||||
def get_title(self):
|
||||
if self.profile == self.request.profile:
|
||||
|
|
|
@ -48,9 +48,7 @@ from django.urls import reverse_lazy
|
|||
from django.utils.http import urlencode
|
||||
|
||||
DEFAULT_SELECT2_JS = settings.STATIC_URL + "libs/select2/select2.js"
|
||||
DEFAULT_SELECT2_CSS = settings.STATIC_URL + (
|
||||
"libs/select2/select2.css"
|
||||
)
|
||||
DEFAULT_SELECT2_CSS = settings.STATIC_URL + ("libs/select2/select2.css")
|
||||
|
||||
__all__ = [
|
||||
"Select2Widget",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue