Add initial navbar
This includes all boards, as well as report counts if the user is an admin. Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
from django.conf import settings as django_settings
|
||||
from board.models import Board
|
||||
from board.models import Board, ReportRecord
|
||||
|
||||
|
||||
def settings(request):
|
||||
@@ -8,3 +8,24 @@ def settings(request):
|
||||
|
||||
def boards(request):
|
||||
return {"boards": Board.objects.filter(readonly=False)}
|
||||
|
||||
|
||||
def reports(request):
|
||||
user = request.user
|
||||
print("reports!")
|
||||
print("reports!")
|
||||
print("reports!")
|
||||
print("reports!")
|
||||
print("reports!")
|
||||
print("reports!")
|
||||
print("reports!")
|
||||
print("reports!")
|
||||
print("reports!")
|
||||
print("reports!")
|
||||
if user and user.has_perm("board.view_reportrecord"):
|
||||
return {
|
||||
"reports": ReportRecord.objects.all(),
|
||||
"reports_urgent": ReportRecord.objects.filter(urgent=True),
|
||||
}
|
||||
else:
|
||||
return {}
|
||||
|
||||
Reference in New Issue
Block a user