Adds color options to announcements
This commit is contained in:
@ -2,10 +2,21 @@
|
||||
from django.db import models
|
||||
from django.db.models import Q
|
||||
from django.utils import timezone
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from .base_model import BookWyrmModel
|
||||
|
||||
|
||||
DisplayTypes = [
|
||||
("white-ter", _("None")),
|
||||
("primary-light", _("Primary")),
|
||||
("success-light", _("Success")),
|
||||
("link-light", _("Link")),
|
||||
("warning-light", _("Warning")),
|
||||
("danger-light", _("Danger")),
|
||||
]
|
||||
|
||||
|
||||
class Announcement(BookWyrmModel):
|
||||
"""The admin has something to say"""
|
||||
|
||||
@ -16,6 +27,13 @@ class Announcement(BookWyrmModel):
|
||||
start_date = models.DateTimeField(blank=True, null=True)
|
||||
end_date = models.DateTimeField(blank=True, null=True)
|
||||
active = models.BooleanField(default=True)
|
||||
display_type = models.CharField(
|
||||
max_length=20,
|
||||
blank=False,
|
||||
null=False,
|
||||
choices=DisplayTypes,
|
||||
default="white-ter",
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def active_announcements(cls):
|
||||
|
Reference in New Issue
Block a user