From e8ba4b05645e08d16a01046cb93c9697c39a8bad Mon Sep 17 00:00:00 2001 From: Matt Date: Tue, 3 Aug 2021 10:03:22 -0700 Subject: [PATCH] #6797: Improve controls & custom link styling --- netbox/extras/choices.py | 38 +- netbox/extras/templatetags/custom_links.py | 4 +- netbox/project-static/dist/netbox-dark.css | 2 +- netbox/project-static/dist/netbox-light.css | 2 +- netbox/project-static/styles/netbox.scss | 27 ++ netbox/project-static/styles/theme-dark.scss | 8 + netbox/project-static/styles/theme-light.scss | 14 + .../circuits/inc/circuit_termination.html | 2 +- netbox/templates/dcim/device/base.html | 370 ++++++++---------- netbox/templates/dcim/devicetype.html | 2 +- netbox/templates/dcim/interface.html | 2 +- netbox/templates/dcim/rack.html | 6 +- .../templates/dcim/rack_elevation_list.html | 10 +- netbox/templates/generic/object.html | 6 +- netbox/templates/generic/object_edit.html | 10 +- netbox/templates/generic/object_list.html | 4 +- .../templates/ipam/inc/toggle_available.html | 7 +- .../templates/ipam/iprange/ip_addresses.html | 2 +- .../templates/ipam/prefix/ip_addresses.html | 2 +- netbox/templates/ipam/prefix_list.html | 4 +- .../virtualization/cluster/base.html | 39 +- .../virtualization/virtualmachine/base.html | 4 +- netbox/utilities/templates/buttons/add.html | 7 +- netbox/utilities/templates/buttons/clone.html | 2 +- .../utilities/templates/buttons/delete.html | 2 +- netbox/utilities/templates/buttons/edit.html | 2 +- .../utilities/templates/buttons/export.html | 4 +- .../utilities/templates/buttons/import.html | 2 +- 28 files changed, 313 insertions(+), 271 deletions(-) diff --git a/netbox/extras/choices.py b/netbox/extras/choices.py index 86860b0bc..4452b5aad 100644 --- a/netbox/extras/choices.py +++ b/netbox/extras/choices.py @@ -46,28 +46,40 @@ class CustomFieldFilterLogicChoices(ChoiceSet): class CustomLinkButtonClassChoices(ChoiceSet): CLASS_DEFAULT = 'outline-dark' - CLASS_PRIMARY = 'primary' - CLASS_SUCCESS = 'success' - CLASS_INFO = 'info' - CLASS_WARNING = 'warning' - CLASS_DANGER = 'danger' - CLASS_LINK = 'link' + 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 = ( (CLASS_DEFAULT, 'Default'), - (CLASS_PRIMARY, 'Primary (blue)'), - (CLASS_SUCCESS, 'Success (green)'), - (CLASS_INFO, 'Info (aqua)'), - (CLASS_WARNING, 'Warning (orange)'), - (CLASS_DANGER, 'Danger (red)'), - (CLASS_LINK, 'None (link)'), + (CLASS_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'), ) - # # ObjectChanges # + class ObjectChangeActionChoices(ChoiceSet): ACTION_CREATE = 'create' diff --git a/netbox/extras/templatetags/custom_links.py b/netbox/extras/templatetags/custom_links.py index 814acbbcb..fec5cf65a 100644 --- a/netbox/extras/templatetags/custom_links.py +++ b/netbox/extras/templatetags/custom_links.py @@ -10,10 +10,10 @@ from utilities.utils import render_jinja2 register = template.Library() -LINK_BUTTON = '{}\n' +LINK_BUTTON = '{}\n' GROUP_BUTTON = """ -