summaryrefslogblamecommitdiffstats
path: root/core/views.py
blob: 60f883788587f6ae99ab00e5fd4f82063a363cac (plain) (tree)





















                                                                           

                                                        
from django.contrib.auth.decorators import login_required
from django.shortcuts import render

from engagements.models import Engagement


@login_required
def index(request):
    subs = Engagement.objects.sp().order_by("proposed_start_date")[:4]
    subs_regulatory = Engagement.objects.sp_regulatory()[:4]
    trans = Engagement.objects.tr()[:4]
    context = dict(subs=subs, trans=trans, subs_regulatory=subs_regulatory)
    return render(request, "core/index.html", context)


@login_required
def dashboard(request):
    return render(request, "core/dashboard.html", {"section": "dashboard"})


@login_required
def profile(request):
    context = {"user": request.user}
    return render(request, "core/profile.html", context)