Ejemplo n.º 1
0
 def render_submission(self, request, submission):
     return render_to_string(
         'programs/submission_header.html',
         context_instance=RequestContext(
             request, {
                 'submission':
                 submission_template_context(request,
                                             submission.programsubmission)
             }))
Ejemplo n.º 2
0
def contest_dashboard_view(request, contest_id):
    top_links = grouper(3, top_links_registry.template_context(request))
    submissions = Submission.objects \
            .filter(problem_instance__contest=request.contest) \
            .order_by('-date').select_related()
    controller = request.contest.controller
    submissions = controller.filter_visible_submissions(request, submissions)
    submissions = submissions[:getattr(settings, 'NUM_DASHBOARD_SUBMISSIONS', 8)]
    submissions = [submission_template_context(request, s) for s in submissions]
    show_scores = bool(s for s in submissions if s.score is not None)
    messages = messages_template_context(request, visible_messages(request))
    context = {
            'top_links': top_links,
            'submissions': submissions,
            'records': messages,
            'show_scores': show_scores
        }
    return TemplateResponse(request, 'dashboard/dashboard.html', context)
Ejemplo n.º 3
0
def contest_dashboard_view(request, contest_id):
    top_links = grouper(3, top_links_registry.template_context(request))
    submissions = Submission.objects \
            .filter(problem_instance__contest=request.contest) \
            .order_by('-date').select_related()
    controller = request.contest.controller
    submissions = controller.filter_visible_submissions(request, submissions)
    submissions = submissions[:getattr(settings, 'NUM_DASHBOARD_SUBMISSIONS', 8
                                       )]
    submissions = [
        submission_template_context(request, s) for s in submissions
    ]
    show_scores = bool(s for s in submissions if s.score is not None)
    messages = messages_template_context(request, visible_messages(request))
    context = {
        'top_links': top_links,
        'submissions': submissions,
        'records': messages,
        'show_scores': show_scores
    }
    return TemplateResponse(request, 'dashboard/dashboard.html', context)
Ejemplo n.º 4
0
 def render_submission(self, request, submission):
     return render_to_string('programs/submission_header.html',
             context_instance=RequestContext(request,
                 {'submission': submission_template_context(request,
                     submission.programsubmission)}))