def getSubmissions(params, user): submissions = [] cont = Contest.getCurrent() if not cont: return "" Submission.forEach(lambda x: submissions.append(x) if x.user.id == user.id and cont.start <= x.timestamp <= cont.end else None) if len(submissions) == 0: return Page(h2("No Submissions Yet", cls="page-title"), ) return Page(h2("Your Submissions", cls="page-title"), *map(SubmissionDisplay, submissions))
def getSubmissions(params, user): submissions = [] cont = Contest.getCurrent() if not cont: return "" Submission.forEach(lambda x: submissions.append(x) if x.user.id == user.id and cont.start <= x.timestamp <= cont.end else None) if len(submissions) == 0: return Page( h2("No Submissions Yet", cls="page-title"), ) return Page( h2("Your Submissions", cls="page-title"), *map(SubmissionDisplay, submissions) )
def getSubmissions(params, user): submissions = [] cont = Contest.getCurrent() if not cont: return "" Submission.forEach(lambda x: submissions.append(x) if x.user.id == user.id and cont.start <= x.timestamp <= cont.end else None) if len(submissions) == 0: return Page(h2("No Submissions Yet", cls="page-title"), ) return Page( h2("Your Submissions", cls="page-title"), SubmissionTable( sorted(submissions, key=lambda sub: (sub.problem.title, -sub.timestamp))), div(cls="modal", tabindex="-1", role="dialog", contents=[ div(cls="modal-dialog", role="document", contents=[div(id="modal-content")]) ]))