summaryrefslogtreecommitdiffstats
path: root/core/views.py
blob: 4e7cd41bc4315d086336780c2b0579e61bbefedc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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):
    args = {"user": request.user}
    return render(request, "core/profile.html", args)