Add UI for action bar

This commit is contained in:
cuom1999 2022-11-16 18:48:32 -06:00
parent f9e9df6056
commit b75a52fe74
22 changed files with 543 additions and 333 deletions

View file

@ -86,6 +86,7 @@ from judge.utils.views import (
generic_message,
)
from judge.ml.collab_filter import CollabFilter
from judge.views.pagevote import PageVoteDetailView, PageVoteListView
def get_contest_problem(problem, profile):
@ -172,7 +173,11 @@ class SolvedProblemMixin(object):
class ProblemSolution(
SolvedProblemMixin, ProblemMixin, TitleMixin, CommentedDetailView
SolvedProblemMixin,
ProblemMixin,
TitleMixin,
CommentedDetailView,
PageVoteDetailView,
):
context_object_name = "problem"
template_name = "problem/editorial.html"
@ -237,7 +242,9 @@ class ProblemRaw(
)
class ProblemDetail(ProblemMixin, SolvedProblemMixin, CommentedDetailView):
class ProblemDetail(
ProblemMixin, SolvedProblemMixin, CommentedDetailView, PageVoteDetailView
):
context_object_name = "problem"
template_name = "problem/problem.html"
@ -806,7 +813,7 @@ class ProblemList(QueryStringSortMixin, TitleMixin, SolvedProblemMixin, ListView
return HttpResponseRedirect(request.get_full_path())
class ProblemFeed(ProblemList):
class ProblemFeed(ProblemList, PageVoteListView):
model = Problem
context_object_name = "problems"
template_name = "problem/feed.html"
@ -832,6 +839,9 @@ class ProblemFeed(ProblemList):
**kwargs
)
def get_comment_page(self, problem):
return "p:%s" % problem.code
# arr = [[], [], ..]
def merge_recommendation(self, arr):
seed = datetime.now().strftime("%d%m%Y")