Skip to content

Views partials

hypha.apply.dashboard.views_partials

my_active_submissions

my_active_submissions(user)
Source code in hypha/apply/dashboard/views_partials.py
def my_active_submissions(user):
    active_subs = (
        ApplicationSubmission.objects.filter(
            user=user,
        )
        .annotate(
            is_active=Case(When(status__in=active_statuses, then=True), default=False)
        )
        .select_related("draft_revision")
        .order_by("-is_active", "-submit_time")
    )
    for submission in active_subs:
        yield submission.from_draft()

applicant_submissions

applicant_submissions(request)
Source code in hypha/apply/dashboard/views_partials.py
@login_required
@require_GET
def applicant_submissions(request):
    active_submissions = list(my_active_submissions(request.user))

    page = request.GET.get("page", 1)
    page = Paginator(active_submissions, per_page=5, orphans=3).page(page)
    return render(
        request,
        template_name="dashboard/partials/applicant_submissions.html",
        context={"page": page},
    )

applicant_projects

applicant_projects(request)
Source code in hypha/apply/dashboard/views_partials.py
@login_required
@require_GET
def applicant_projects(request):
    active_projects = Project.objects.filter(user=request.user).order_by("-created_at")
    page = request.GET.get("page", 1)
    page = Paginator(active_projects, per_page=5, orphans=3).page(page)
    return render(
        request,
        template_name="dashboard/partials/applicant_projects.html",
        context={"page": page},
    )