diff options
author | Andrea Lepori <aleporia@gmail.com> | 2023-07-25 12:14:12 +0200 |
---|---|---|
committer | Andrea Lepori <aleporia@gmail.com> | 2023-07-25 12:14:13 +0200 |
commit | da6654f57ef683c8c1f2f4c2eab52d907ba1925b (patch) | |
tree | 086273bf46a649b10349bfdda752c13571f3d6b1 /client/views.py | |
parent | clean up old settings menu (diff) | |
download | scout-subs-da6654f57ef683c8c1f2f4c2eab52d907ba1925b.tar.gz scout-subs-da6654f57ef683c8c1f2f4c2eab52d907ba1925b.zip |
change branca and color to show
Diffstat (limited to '')
-rw-r--r-- | client/views.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/client/views.py b/client/views.py index dfb5dbf..5160927 100644 --- a/client/views.py +++ b/client/views.py @@ -95,7 +95,18 @@ def index(request): for uc in ucs: documents = Document.objects.filter( Q(usercode=uc) & ~Q(status='archive')).select_related("personal_data", "medical_data", "document_type", "user") - docs.append([uc, documents]) + color_mapping = { + "diga": "#ffeb3b", + "muta": "#03a9f4", + "reparto": "#795548", + "posto": "#f44336", + "clan": "#4caf50" + } + if uc.branca == None: + color = "black" + else: + color = color_mapping[uc.branca.name] + docs.append([uc, documents, color]) # show only docs of the user and non archived vac_file = ["/server/media/", "/vac_certificate/doc"] |