mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-20 02:06:42 -06:00
Clean up & expand button color choices
This commit is contained in:
parent
ae3c871438
commit
9f53497e39
@ -1,4 +1,4 @@
|
|||||||
from utilities.choices import ChoiceSet
|
from utilities.choices import ButtonColorChoices, ChoiceSet
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -47,36 +47,13 @@ class CustomFieldFilterLogicChoices(ChoiceSet):
|
|||||||
# CustomLinks
|
# CustomLinks
|
||||||
#
|
#
|
||||||
|
|
||||||
class CustomLinkButtonClassChoices(ChoiceSet):
|
class CustomLinkButtonClassChoices(ButtonColorChoices):
|
||||||
|
|
||||||
CLASS_DEFAULT = 'outline-dark'
|
LINK = 'ghost-dark'
|
||||||
CLASS_LINK = 'ghost-dark'
|
|
||||||
CLASS_BLUE = 'blue'
|
|
||||||
CLASS_INDIGO = 'indigo'
|
|
||||||
CLASS_PURPLE = 'purple'
|
|
||||||
CLASS_PINK = 'pink'
|
|
||||||
CLASS_RED = 'red'
|
|
||||||
CLASS_ORANGE = 'orange'
|
|
||||||
CLASS_YELLOW = 'yellow'
|
|
||||||
CLASS_GREEN = 'green'
|
|
||||||
CLASS_TEAL = 'teal'
|
|
||||||
CLASS_CYAN = 'cyan'
|
|
||||||
CLASS_GRAY = 'secondary'
|
|
||||||
|
|
||||||
CHOICES = (
|
CHOICES = (
|
||||||
(CLASS_DEFAULT, 'Default'),
|
*ButtonColorChoices.CHOICES,
|
||||||
(CLASS_LINK, 'Link'),
|
(LINK, 'Link'),
|
||||||
(CLASS_BLUE, 'Blue'),
|
|
||||||
(CLASS_INDIGO, 'Indigo'),
|
|
||||||
(CLASS_PURPLE, 'Purple'),
|
|
||||||
(CLASS_PINK, 'Pink'),
|
|
||||||
(CLASS_RED, 'Red'),
|
|
||||||
(CLASS_ORANGE, 'Orange'),
|
|
||||||
(CLASS_YELLOW, 'Yellow'),
|
|
||||||
(CLASS_GREEN, 'Green'),
|
|
||||||
(CLASS_TEAL, 'Teal'),
|
|
||||||
(CLASS_CYAN, 'Cyan'),
|
|
||||||
(CLASS_GRAY, 'Gray'),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -212,7 +212,7 @@ class CustomLink(ChangeLoggedModel):
|
|||||||
button_class = models.CharField(
|
button_class = models.CharField(
|
||||||
max_length=30,
|
max_length=30,
|
||||||
choices=CustomLinkButtonClassChoices,
|
choices=CustomLinkButtonClassChoices,
|
||||||
default=CustomLinkButtonClassChoices.CLASS_DEFAULT,
|
default=CustomLinkButtonClassChoices.DEFAULT,
|
||||||
help_text="The class of the first link in a group will be used for the dropdown button"
|
help_text="The class of the first link in a group will be used for the dropdown button"
|
||||||
)
|
)
|
||||||
new_window = models.BooleanField(
|
new_window = models.BooleanField(
|
||||||
|
@ -161,21 +161,34 @@ class ButtonColorChoices(ChoiceSet):
|
|||||||
Map standard button color choices to Bootstrap 3 button classes
|
Map standard button color choices to Bootstrap 3 button classes
|
||||||
"""
|
"""
|
||||||
DEFAULT = 'outline-dark'
|
DEFAULT = 'outline-dark'
|
||||||
BLUE = 'primary'
|
BLUE = 'blue'
|
||||||
CYAN = 'info'
|
INDIGO = 'indigo'
|
||||||
GREEN = 'success'
|
PURPLE = 'purple'
|
||||||
RED = 'danger'
|
PINK = 'pink'
|
||||||
YELLOW = 'warning'
|
RED = 'red'
|
||||||
GREY = 'secondary'
|
ORANGE = 'orange'
|
||||||
BLACK = 'dark'
|
YELLOW = 'yellow'
|
||||||
|
GREEN = 'green'
|
||||||
|
TEAL = 'teal'
|
||||||
|
CYAN = 'cyan'
|
||||||
|
GRAY = 'gray'
|
||||||
|
GREY = 'gray' # Backward compatability for <3.2
|
||||||
|
BLACK = 'black'
|
||||||
|
WHITE = 'white'
|
||||||
|
|
||||||
CHOICES = (
|
CHOICES = (
|
||||||
(DEFAULT, 'Default'),
|
(DEFAULT, 'Default'),
|
||||||
(BLUE, 'Blue'),
|
(BLUE, 'Blue'),
|
||||||
(CYAN, 'Cyan'),
|
(INDIGO, 'Indigo'),
|
||||||
(GREEN, 'Green'),
|
(PURPLE, 'Purple'),
|
||||||
|
(PINK, 'Pink'),
|
||||||
(RED, 'Red'),
|
(RED, 'Red'),
|
||||||
|
(ORANGE, 'Orange'),
|
||||||
(YELLOW, 'Yellow'),
|
(YELLOW, 'Yellow'),
|
||||||
(GREY, 'Grey'),
|
(GREEN, 'Green'),
|
||||||
(BLACK, 'Black')
|
(TEAL, 'Teal'),
|
||||||
|
(CYAN, 'Cyan'),
|
||||||
|
(GRAY, 'Gray'),
|
||||||
|
(BLACK, 'Black'),
|
||||||
|
(WHITE, 'White'),
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user