Pārlūkot izejas kodu

fix(navigation): Normalize default menu button color

Render navigation menu buttons with the secondary ghost style when their
color is unset or set to the default choice.

This fixes plugin menu buttons, which default to "default" rather than
None, while preserving explicitly configured button colors.
Martin Hauser 4 mēneši atpakaļ
vecāks
revīzija
8c898e7713
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      netbox/utilities/templates/navigation/menu.html

+ 1 - 1
netbox/utilities/templates/navigation/menu.html

@@ -45,7 +45,7 @@
                   {% if buttons %}
                   {% if buttons %}
                     <div class="dropdown-item-buttons d-inline-flex ms-1">
                     <div class="dropdown-item-buttons d-inline-flex ms-1">
                       {% for button in buttons %}
                       {% for button in buttons %}
-                        <a href="{{ button.url }}" class="btn btn-sm btn-ghost btn-{{ button.color|default:"secondary" }} px-2" title="{{ button.title }}" aria-label="{{ button.title }}">
+                        <a href="{{ button.url }}" class="btn btn-sm btn-ghost btn-{% if button.color and button.color != 'default' %}{{ button.color }}{% else %}secondary{% endif %} px-2" title="{{ button.title }}" aria-label="{{ button.title }}">
                           <i class="{{ button.icon_class }}" aria-hidden="true"></i>
                           <i class="{{ button.icon_class }}" aria-hidden="true"></i>
                         </a>
                         </a>
                       {% endfor %}
                       {% endfor %}