1 ##############################################################################
2 # Copyright (c) 2018 Sawyer Bergeron and others.
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
10 from notifier.models import *
11 from django.shortcuts import render
13 def InboxView(request):
14 if request.user.is_authenticated:
17 return render(request, "dashboard/login.html", {'title': 'Authentication Required'})
19 return render(request, "notifier/inbox.html", {'notifier_messages': Notifier.objects.filter(user=user.userprofile)})
22 def NotificationView(request, notification_id):
23 if notification_id == 0:
25 if request.user.is_authenticated:
28 return render(request, "dashboard/login.html", {'title': 'Authentication Required'})
30 notification = Notifier.objects.get(id=notification_id)
31 if not notification.user.user.username == user.username:
32 return render(request, "dashboard/login.html", {'title': 'Access Denied'})
34 return render(request, "notifier/notification.html", {'notification': notification})