From 706bb44fc600951bfb44f3ab1692885adb068a56 Mon Sep 17 00:00:00 2001 From: Jan Krupa Date: Tue, 13 Aug 2024 07:22:33 +0000 Subject: [PATCH] Fix dissapearing search button in additional tab --- netbox_attachments/template_content.py | 2 +- .../netbox_attachments/generic_tab_list.html | 14 ++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/netbox_attachments/template_content.py b/netbox_attachments/template_content.py index 5a596ab..d7679e5 100644 --- a/netbox_attachments/template_content.py +++ b/netbox_attachments/template_content.py @@ -73,7 +73,7 @@ def buttons(self): return Button -def create_tab_view(model, base_template_name="generic/object.html"): +def create_tab_view(model, base_template_name="generic/object_children.html"): """Creates attachment tab. Append it to the passed model Args: diff --git a/netbox_attachments/templates/netbox_attachments/generic_tab_list.html b/netbox_attachments/templates/netbox_attachments/generic_tab_list.html index fb5145f..9b9730b 100644 --- a/netbox_attachments/templates/netbox_attachments/generic_tab_list.html +++ b/netbox_attachments/templates/netbox_attachments/generic_tab_list.html @@ -1,13 +1,15 @@ {% extends base_template_name %} {% load render_table from django_tables2 %} {% load static %} +{% load helpers %} {% if perms.netbox_attachments.view_netboxattachment %} {% block content %} - {% load helpers %} + {% block table_controls %} + {% include "inc/table_controls_htmx.html" with table_modal="NetBoxAttachmentTable_config" %} + {% endblock table_controls %}
- {% include "inc/table_controls_htmx.html" with table_modal="NetBoxAttachmentTable_config" %} - {% include "htmx/table.html" %} + {% htmx_table 'plugins:netbox_attachments:netboxattachment_list' object_type_id=object|content_type_id object_id=object.pk %}
@@ -15,7 +17,7 @@
{% if perms.netbox_attachments.add_netboxattachment %} + class="btn btn-primary"> Add Attachment @@ -24,7 +26,3 @@
{% endblock content %} {% endif %} -{% block modals %} - {{ block.super }} - {% table_config_form table %} -{% endblock modals %}