Department colours and order
This commit is contained in:
parent
2fb6ea6c64
commit
2364277c1a
@ -111,7 +111,7 @@ class DepartmentSerializer(DynamicModelSerializer):
|
|||||||
class Meta:
|
class Meta:
|
||||||
model = Department
|
model = Department
|
||||||
fields = [
|
fields = [
|
||||||
"uuid", "title", "icon"
|
"uuid", "title", "colour", "backgroundcolour", "order"
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ class UserAdmin(admin.ModelAdmin):
|
|||||||
|
|
||||||
class DepartmentAdmin(admin.ModelAdmin):
|
class DepartmentAdmin(admin.ModelAdmin):
|
||||||
|
|
||||||
list_display = ["uuid", "title", "icon", "get_user_count"]
|
list_display = ["uuid", "title", "colour", "backgroundcolour", "order", "get_user_count"]
|
||||||
|
|
||||||
@admin.display(description="Users")
|
@admin.display(description="Users")
|
||||||
def get_user_count(self, obj):
|
def get_user_count(self, obj):
|
||||||
|
@ -4,7 +4,9 @@
|
|||||||
"pk": "4e245769-6b67-4a6e-b804-54a3ceb3b8c0",
|
"pk": "4e245769-6b67-4a6e-b804-54a3ceb3b8c0",
|
||||||
"fields": {
|
"fields": {
|
||||||
"title": "Development",
|
"title": "Development",
|
||||||
"icon": null
|
"colour": "#1976d2",
|
||||||
|
"backgroundcolour": "#bbdefb",
|
||||||
|
"order": 4
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -12,7 +14,9 @@
|
|||||||
"pk": "85b46ae8-0a19-48b7-8a21-a01abd78a470",
|
"pk": "85b46ae8-0a19-48b7-8a21-a01abd78a470",
|
||||||
"fields": {
|
"fields": {
|
||||||
"title": "Marketing",
|
"title": "Marketing",
|
||||||
"icon": null
|
"colour": "#7b1fa2",
|
||||||
|
"backgroundcolour": "#e1bee7",
|
||||||
|
"order": 1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -20,7 +24,9 @@
|
|||||||
"pk": "a6517555-0bcc-4baa-8e2f-798916562b1c",
|
"pk": "a6517555-0bcc-4baa-8e2f-798916562b1c",
|
||||||
"fields": {
|
"fields": {
|
||||||
"title": "Management",
|
"title": "Management",
|
||||||
"icon": null
|
"colour": "#689f38",
|
||||||
|
"backgroundcolour": "#dcedc8",
|
||||||
|
"order": 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -28,7 +34,9 @@
|
|||||||
"pk": "bae35c7a-a929-4465-b70f-03254b0774e0",
|
"pk": "bae35c7a-a929-4465-b70f-03254b0774e0",
|
||||||
"fields": {
|
"fields": {
|
||||||
"title": "Sales",
|
"title": "Sales",
|
||||||
"icon": null
|
"colour": "#e64a19",
|
||||||
|
"backgroundcolour": "#ffccbc",
|
||||||
|
"order": 2
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -36,7 +44,9 @@
|
|||||||
"pk": "c2bbabd7-05ac-4bc8-97a3-15bafdb478d9",
|
"pk": "c2bbabd7-05ac-4bc8-97a3-15bafdb478d9",
|
||||||
"fields": {
|
"fields": {
|
||||||
"title": "Business Strategy",
|
"title": "Business Strategy",
|
||||||
"icon": null
|
"colour": "#c2185b",
|
||||||
|
"backgroundcolour": "#f8bbd0",
|
||||||
|
"order": 3
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# Generated by Django 3.2.16 on 2024-01-20 19:15
|
# Generated by Django 3.2.16 on 2024-01-22 14:39
|
||||||
|
|
||||||
import apps.authentication.models
|
import apps.authentication.models
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
@ -21,7 +21,9 @@ class Migration(migrations.Migration):
|
|||||||
fields=[
|
fields=[
|
||||||
('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
||||||
('title', models.CharField(max_length=150)),
|
('title', models.CharField(max_length=150)),
|
||||||
('icon', models.CharField(blank=True, max_length=32, null=True)),
|
('colour', models.CharField(max_length=7)),
|
||||||
|
('backgroundcolour', models.CharField(max_length=7)),
|
||||||
|
('order', models.PositiveIntegerField(default=0)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
|
@ -31,7 +31,9 @@ class Department(models.Model):
|
|||||||
uuid = models.UUIDField(primary_key=True, default=uuid4, editable=False)
|
uuid = models.UUIDField(primary_key=True, default=uuid4, editable=False)
|
||||||
|
|
||||||
title = models.CharField(max_length=150)
|
title = models.CharField(max_length=150)
|
||||||
icon = models.CharField(max_length=32, null=True, blank=True)
|
colour = models.CharField(max_length=7)
|
||||||
|
backgroundcolour = models.CharField(max_length=7)
|
||||||
|
order = models.PositiveIntegerField(default=0, blank=False, null=False)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.title
|
return self.title
|
||||||
|
@ -31,7 +31,7 @@ class TicketView(TemplateView):
|
|||||||
def get(self, request):
|
def get(self, request):
|
||||||
priorities = TicketPriority.objects.all().order_by("order")
|
priorities = TicketPriority.objects.all().order_by("order")
|
||||||
tags = TicketTag.objects.all().order_by("order")
|
tags = TicketTag.objects.all().order_by("order")
|
||||||
departments = Department.objects.all()
|
departments = Department.objects.all().order_by("order")
|
||||||
|
|
||||||
context = {
|
context = {
|
||||||
"priorities": priorities,
|
"priorities": priorities,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user