Rewrite org page
This commit is contained in:
parent
05ff359f89
commit
82ec9e098d
22 changed files with 1190 additions and 777 deletions
|
@ -69,31 +69,15 @@ class FeedView(ListView):
|
|||
|
||||
now = timezone.now()
|
||||
|
||||
# Dashboard stuff
|
||||
# if self.request.user.is_authenticated:
|
||||
# user = self.request.profile
|
||||
# context['recently_attempted_problems'] = (Submission.objects.filter(user=user)
|
||||
# .exclude(problem__in=user_completed_ids(user))
|
||||
# .values_list('problem__code', 'problem__name', 'problem__points')
|
||||
# .annotate(points=Max('points'), latest=Max('date'))
|
||||
# .order_by('-latest')
|
||||
# [:settings.DMOJ_BLOG_RECENTLY_ATTEMPTED_PROBLEMS_COUNT])
|
||||
|
||||
visible_contests = (
|
||||
Contest.get_visible_contests(self.request.user)
|
||||
.filter(is_visible=True)
|
||||
.order_by("start_time")
|
||||
)
|
||||
|
||||
context["current_contests"] = visible_contests.filter(
|
||||
start_time__lte=now, end_time__gt=now
|
||||
)
|
||||
context["future_contests"] = visible_contests.filter(start_time__gt=now)
|
||||
|
||||
visible_contests = Contest.get_visible_contests(self.request.user).filter(
|
||||
is_visible=True
|
||||
)
|
||||
|
||||
context["top_rated"] = Profile.objects.filter(is_unlisted=False).order_by(
|
||||
"-rating"
|
||||
)[:10]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue