Skip to content

Commit

Permalink
Merge pull request #170 from ArnesSI/tables
Browse files Browse the repository at this point in the history
update tables to htmx_table macro
  • Loading branch information
matejv authored May 13, 2024
2 parents 14da383 + e0181f0 commit eac15ac
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
6 changes: 6 additions & 0 deletions netbox_inventory/filtersets.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,12 @@ class InventoryItemGroupFilterSet(NetBoxModelFilterSet):
queryset=InventoryItemGroup.objects.all(),
label='Parent group (ID)',
)
ancestor_id = filters.TreeNodeMultipleChoiceFilter(
queryset=InventoryItemGroup.objects.all(),
field_name='parent',
lookup_expr='in',
label='Inventory item group (ID)',
)

class Meta:
model = InventoryItemGroup
Expand Down
1 change: 0 additions & 1 deletion netbox_inventory/templates/netbox_inventory/delivery.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{% extends 'generic/object.html' %}
{% load helpers %}
{% load plugins %}
{% load render_table from django_tables2 %}

{% block breadcrumbs %}
{{ block.super }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{% extends 'generic/object.html' %}
{% load helpers %}
{% load plugins %}
{% load render_table from django_tables2 %}

{% block breadcrumbs %}
{{ block.super }}
Expand Down Expand Up @@ -116,7 +115,7 @@ <h5 class="card-header">
</div>
{% endif %}
</h5>
{% render_table child_groups_table 'inc/table.html' %}
{% htmx_table 'plugins:netbox_inventory:inventoryitemgroup_list' ancestor_id=object.pk %}
</div>
{% include 'inc/panels/tags.html' %}
{% include 'inc/panels/comments.html' %}
Expand All @@ -127,8 +126,7 @@ <h5 class="card-header">
<div class="col col-md-12">
<div class="card">
<h5 class="card-header">Assets</h5>
{% render_table asset_table 'inc/table.html' %}
{% include 'inc/paginator.html' with paginator=asset_table.paginator page=asset_table.page %}
{% htmx_table 'plugins:netbox_inventory:asset_list' inventoryitem_group_id=object.pk %}
</div>
{% plugin_full_width_page object %}
</div>
Expand Down
1 change: 0 additions & 1 deletion netbox_inventory/templates/netbox_inventory/purchase.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{% extends 'generic/object.html' %}
{% load helpers %}
{% load plugins %}
{% load render_table from django_tables2 %}

{% block breadcrumbs %}
{{ block.super }}
Expand Down
1 change: 0 additions & 1 deletion netbox_inventory/templates/netbox_inventory/supplier.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{% extends 'generic/object.html' %}
{% load plugins %}
{% load render_table from django_tables2 %}

{% block breadcrumbs %}
<li class="breadcrumb-item"><a href="{% url 'plugins:netbox_inventory:supplier_list' %}">Suppliers</a></li>
Expand Down

0 comments on commit eac15ac

Please sign in to comment.