mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-08 00:28:16 -06:00
16756 don't duplicate code
This commit is contained in:
parent
7b21ee484f
commit
f64050a9f5
@ -1,7 +1,6 @@
|
|||||||
{% load helpers %}
|
{% load helpers %}
|
||||||
{% load log_levels %}
|
{% load log_levels %}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
{% load render_table from django_tables2 %}
|
|
||||||
|
|
||||||
<div class="htmx-container">
|
<div class="htmx-container">
|
||||||
<p>
|
<p>
|
||||||
@ -42,21 +41,7 @@
|
|||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="table-responsive" id="object_list">
|
<div class="table-responsive" id="object_list">
|
||||||
<h5 class="card-header">{% trans "Log" %}</h5>
|
<h5 class="card-header">{% trans "Log" %}</h5>
|
||||||
|
{% include 'htmx/table.html' with no_htmx_container=True%}
|
||||||
<div class="table-responsive">
|
|
||||||
{% with preferences|get_key:"pagination.placement" as paginator_placement %}
|
|
||||||
{% if paginator_placement == 'top' or paginator_placement == 'both' %}
|
|
||||||
{% include 'inc/paginator.html' with htmx=True table=table paginator=table.paginator page=table.page placement='top' %}
|
|
||||||
{% endif %}
|
|
||||||
{% render_table table 'inc/table_htmx.html' %}
|
|
||||||
{% if paginator_placement != 'top' %}
|
|
||||||
{% include 'inc/paginator.html' with htmx=True table=table paginator=table.paginator page=table.page %}
|
|
||||||
{% endif %}
|
|
||||||
{% endwith %}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{# Include the updated object count for display elsewhere on the page #}
|
|
||||||
<div class="d-none" hx-swap-oob="innerHTML:.total-object-count">{{ table.rows|length }}</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
{% load helpers %}
|
{% load helpers %}
|
||||||
{% load render_table from django_tables2 %}
|
{% load render_table from django_tables2 %}
|
||||||
|
|
||||||
<div class="htmx-container table-responsive">
|
<div class="{% if not no_htmx_container %}htmx-container{% endif %} table-responsive">
|
||||||
{% with preferences|get_key:"pagination.placement" as paginator_placement %}
|
{% with preferences|get_key:"pagination.placement" as paginator_placement %}
|
||||||
{% if paginator_placement == 'top' or paginator_placement == 'both' %}
|
{% if paginator_placement == 'top' or paginator_placement == 'both' %}
|
||||||
{% include 'inc/paginator.html' with htmx=True table=table paginator=table.paginator page=table.page placement='top' %}
|
{% include 'inc/paginator.html' with htmx=True table=table paginator=table.paginator page=table.page placement='top' %}
|
||||||
|
Loading…
Reference in New Issue
Block a user