summaryrefslogtreecommitdiffstats
path: root/core/views.py
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2024-04-23 11:16:38 +0100
committerMatthew Lemon <y@yulqen.org>2024-04-23 11:16:38 +0100
commit0f951dcf029d4af284467543a3afdf5bf6581a20 (patch)
treea48384210cdc168e3bd3ccff6d6d516eeed9e748 /core/views.py
parent8b084e9fe7a5f3a04c32daf9a24f7f2cf67300f9 (diff)
switched to Django
Diffstat (limited to 'core/views.py')
-rw-r--r--core/views.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/core/views.py b/core/views.py
new file mode 100644
index 0000000..4e7cd41
--- /dev/null
+++ b/core/views.py
@@ -0,0 +1,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)