Parcourir la source

Introduce modals template block

jeremystretch il y a 4 ans
Parent
commit
2524290099

+ 3 - 0
netbox/templates/base/layout.html

@@ -103,6 +103,9 @@
           </div>
         {% endif %}
 
+        {# BS5 pop-up modals #}
+        {% block modals %}{% endblock %}
+
         {# Page footer #}
         <footer class="footer container-fluid">
           <div class="row align-items-center justify-content-between mx-0">

+ 4 - 1
netbox/templates/dcim/device/consoleports.html

@@ -42,5 +42,8 @@
         {% endif %}
     </div>
   </form>
-  {% table_config_form table %}
 {% endblock %}
+
+{% block modals %}
+  {% table_config_form table %}
+{% endblock modals %}

+ 4 - 1
netbox/templates/dcim/device/consoleserverports.html

@@ -42,5 +42,8 @@
         {% endif %}
     </div>
   </form>
-  {% table_config_form table %}
 {% endblock %}
+
+{% block modals %}
+  {% table_config_form table %}
+{% endblock modals %}

+ 4 - 1
netbox/templates/dcim/device/devicebays.html

@@ -39,5 +39,8 @@
         {% endif %}
     </div>
   </form>
-  {% table_config_form table %}
 {% endblock %}
+
+{% block modals %}
+  {% table_config_form table %}
+{% endblock modals %}

+ 4 - 1
netbox/templates/dcim/device/frontports.html

@@ -42,5 +42,8 @@
         {% endif %}
     </div>
   </form>
-  {% table_config_form table %}
 {% endblock %}
+
+{% block modals %}
+  {% table_config_form table %}
+{% endblock modals %}

+ 4 - 1
netbox/templates/dcim/device/interfaces.html

@@ -77,5 +77,8 @@
         {% endif %}
     </div>
   </form>
-  {% table_config_form table %}
 {% endblock %}
+
+{% block modals %}
+  {% table_config_form table %}
+{% endblock modals %}

+ 4 - 1
netbox/templates/dcim/device/inventory.html

@@ -39,5 +39,8 @@
         {% endif %}
     </div>
   </form>
-  {% table_config_form table %}
 {% endblock %}
+
+{% block modals %}
+  {% table_config_form table %}
+{% endblock modals %}

+ 4 - 1
netbox/templates/dcim/device/poweroutlets.html

@@ -42,5 +42,8 @@
         {% endif %}
     </div>
   </form>
-  {% table_config_form table %}
 {% endblock %}
+
+{% block modals %}
+  {% table_config_form table %}
+{% endblock modals %}

+ 4 - 1
netbox/templates/dcim/device/powerports.html

@@ -42,5 +42,8 @@
         {% endif %}
     </div>
   </form>
-  {% table_config_form table %}
 {% endblock %}
+
+{% block modals %}
+  {% table_config_form table %}
+{% endblock modals %}

+ 4 - 1
netbox/templates/dcim/device/rearports.html

@@ -42,5 +42,8 @@
         {% endif %}
     </div>
   </form>
-  {% table_config_form table %}
 {% endblock %}
+
+{% block modals %}
+  {% table_config_form table %}
+{% endblock modals %}

+ 4 - 2
netbox/templates/generic/object_list.html

@@ -133,6 +133,8 @@
     {% endif %}
   </div>
 
-  {# Table config form #}
-  {% table_config_form table table_name="ObjectTable" %}
 {% endblock content-wrapper %}
+
+{% block modals %}
+  {% table_config_form table table_name="ObjectTable" %}
+{% endblock modals %}

+ 4 - 1
netbox/templates/ipam/aggregate/prefixes.html

@@ -37,5 +37,8 @@
       </div>
     </div>
   </form>
-  {% table_config_form table %}
 {% endblock %}
+
+{% block modals %}
+  {% table_config_form table %}
+{% endblock modals %}

+ 4 - 1
netbox/templates/ipam/iprange/ip_addresses.html

@@ -35,5 +35,8 @@
       </div>
     </div>
   </form>
-  {% table_config_form table %}
 {% endblock %}
+
+{% block modals %}
+  {% table_config_form table %}
+{% endblock modals %}

+ 4 - 1
netbox/templates/ipam/prefix/ip_addresses.html

@@ -35,5 +35,8 @@
       </div>
     </div>
   </form>
-  {% table_config_form table %}
 {% endblock %}
+
+{% block modals %}
+  {% table_config_form table %}
+{% endblock modals %}

+ 4 - 1
netbox/templates/ipam/prefix/ip_ranges.html

@@ -35,5 +35,8 @@
       </div>
     </div>
   </form>
-  {% table_config_form table %}
 {% endblock %}
+
+{% block modals %}
+  {% table_config_form table %}
+{% endblock modals %}

+ 4 - 1
netbox/templates/ipam/prefix/prefixes.html

@@ -37,5 +37,8 @@
       </div>
     </div>
   </form>
-  {% table_config_form table %}
 {% endblock %}
+
+{% block modals %}
+  {% table_config_form table %}
+{% endblock modals %}

+ 4 - 3
netbox/templates/ipam/vlan/interfaces.html

@@ -5,13 +5,14 @@
   <form method="post">
     {% csrf_token %}
     {% include 'inc/table_controls_htmx.html' with table_modal="VLANDevicesTable_config" %}
-
     <div class="card">
       <div class="card-body" id="object_list">
         {% include 'htmx/table.html' %}
       </div>
     </div>
-
   </form>
+{% endblock content %}
+
+{% block modals %}
   {% table_config_form table %}
-{% endblock %}
+{% endblock modals %}

+ 4 - 3
netbox/templates/ipam/vlan/vminterfaces.html

@@ -5,13 +5,14 @@
   <form method="post">
     {% csrf_token %}
     {% include 'inc/table_controls_htmx.html' with table_modal="VLANVirtualMachinesTable_config" %}
-
     <div class="card">
       <div class="card-body" id="object_list">
         {% include 'htmx/table.html' %}
       </div>
     </div>
-
   </form>
+{% endblock content %}
+
+{% block modals %}
   {% table_config_form table %}
-{% endblock %}
+{% endblock modals %}

+ 4 - 3
netbox/templates/virtualization/cluster/devices.html

@@ -6,13 +6,11 @@
   <form action="{% url 'virtualization:cluster_remove_devices' pk=object.pk %}" method="post">
     {% csrf_token %}
     {% include 'inc/table_controls_htmx.html' with table_modal="DeviceTable_config" %}
-
     <div class="card">
       <div class="card-body" id="object_list">
         {% include 'htmx/table.html' %}
       </div>
     </div>
-
     <div class="noprint bulk-buttons">
       <div class="bulk-button-group">
         {% if perms.virtualization.change_cluster %}
@@ -23,5 +21,8 @@
       </div>
     </div>
   </form>
+{% endblock content %}
+
+{% block modals %}
   {% table_config_form table %}
-{% endblock %}
+{% endblock modals %}

+ 4 - 3
netbox/templates/virtualization/cluster/virtual_machines.html

@@ -6,13 +6,11 @@
   <form method="post">
     {% csrf_token %}
     {% include 'inc/table_controls_htmx.html' with table_modal="VirtualMachineTable_config" %}
-
     <div class="card">
       <div class="card-body" id="object_list">
         {% include 'htmx/table.html' %}
       </div>
     </div>
-
     <div class="noprint bulk-buttons">
       <div class="bulk-button-group">
         {% if perms.virtualization.change_virtualmachine %}
@@ -28,5 +26,8 @@
       </div>
     </div>
   </form>
+{% endblock content %}
+
+{% block modals %}
   {% table_config_form table %}
-{% endblock %}
+{% endblock modals %}

+ 4 - 1
netbox/templates/virtualization/virtualmachine/interfaces.html

@@ -37,5 +37,8 @@
         <div class="clearfix"></div>
      </div>
   </form>
+{% endblock content %}
+
+{% block modals %}
   {% table_config_form table %}
-{% endblock %}
+{% endblock modals %}