Procházet zdrojové kódy

Annotate begin & end of panels in HTML

Jeremy Stretch před 3 měsíci
rodič
revize
3e43226901

+ 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" }} -->