From dec7ac79bfca50817b19a28ea0fe1a6cfdd3a1cd Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Tue, 27 Aug 2024 14:16:35 -0400 Subject: [PATCH] Misc cleanup --- netbox/extras/migrations/0116_custom_link_button_color.py | 2 -- netbox/extras/templatetags/custom_links.py | 6 +----- netbox/netbox/choices.py | 3 --- 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/netbox/extras/migrations/0116_custom_link_button_color.py b/netbox/extras/migrations/0116_custom_link_button_color.py index 7295d7fc0..665d73017 100644 --- a/netbox/extras/migrations/0116_custom_link_button_color.py +++ b/netbox/extras/migrations/0116_custom_link_button_color.py @@ -1,5 +1,3 @@ -# Generated by Django 5.0.8 on 2024-08-22 19:39 - from django.db import migrations, models diff --git a/netbox/extras/templatetags/custom_links.py b/netbox/extras/templatetags/custom_links.py index feb12fd9a..4aeaaa6b1 100644 --- a/netbox/extras/templatetags/custom_links.py +++ b/netbox/extras/templatetags/custom_links.py @@ -60,13 +60,9 @@ def custom_links(context, obj): # Add non-grouped links else: + button_class = 'outline-secondary' if cl.button_class == ButtonColorChoices.DEFAULT else cl.button_class try: if rendered := cl.render(link_context): - if cl.button_class == ButtonColorChoices.DEFAULT: - button_class = 'outline-secondary' - else: - button_class = cl.button_class - template_code += LINK_BUTTON.format( rendered['link'], rendered['link_target'], button_class, rendered['text'] ) diff --git a/netbox/netbox/choices.py b/netbox/netbox/choices.py index 60a1969b1..4fd730255 100644 --- a/netbox/netbox/choices.py +++ b/netbox/netbox/choices.py @@ -81,9 +81,6 @@ class ColorChoices(ChoiceSet): # class ButtonColorChoices(ChoiceSet): - """ - Map standard button color choices to Bootstrap 3 button classes - """ DEFAULT = 'default' BLUE = 'blue' INDIGO = 'indigo'