Просмотр исходного кода

Annotate begin & end of panels in HTML

Jeremy Stretch 3 месяцев назад
Родитель
Сommit
3e43226901
2 измененных файлов с 3 добавлено и 0 удалено
  1. 1 0
      netbox/netbox/ui/panels.py
  2. 2 0
      netbox/templates/ui/panels/_base.html

+ 1 - 0
netbox/netbox/ui/panels.py

@@ -65,6 +65,7 @@ class Panel:
             'object': context.get('object'),
             'title': self.title,
             'actions': self.actions,
+            'panel_class': self.__class__.__name__,
         }
 
     def render(self, context):

+ 2 - 0
netbox/templates/ui/panels/_base.html

@@ -1,3 +1,4 @@
+<!-- begin {{ panel_class|default:"panel" }} -->
 <div class="card">
   <h2 class="card-header">
     {{ title }}
@@ -11,3 +12,4 @@
   </h2>
   {% block panel_content %}{% endblock %}
 </div>
+<!-- end {{ panel_class|default:"panel" }} -->