Employ the htmx_table template tag to render all HTMX-backed object tables #8148

Closed
opened 2025-12-29 20:33:06 +01:00 by adam · 0 comments
Owner

Originally created by @jeremystretch on GitHub (May 31, 2023).

Originally assigned to: @jeremystretch on GitHub.

Proposed Changes

Replace all instances of template code which explicitly embeds an HTMX table with the new htmx_table tag. For instance,

<div class="card-body htmx-container table-responsive"
        hx-get="{% url 'circuits:provideraccount_list' %}?provider_id={{ object.pk }}"
        hx-trigger="load"
      ></div>

becomes

{% htmx_table 'circuits:provideraccount_list' provider_id=object.pk %}

Justification

The htmx_table tag was introduced under #12538 to standardize and simplify our approach for embedding HTMX-backed object tables. Among other benefits, this ensures that the return_url parameter is passed correctly for every embedded table.

Originally created by @jeremystretch on GitHub (May 31, 2023). Originally assigned to: @jeremystretch on GitHub. ### Proposed Changes Replace all instances of template code which explicitly embeds an HTMX table with the new `htmx_table` tag. For instance, ``` <div class="card-body htmx-container table-responsive" hx-get="{% url 'circuits:provideraccount_list' %}?provider_id={{ object.pk }}" hx-trigger="load" ></div> ``` becomes ``` {% htmx_table 'circuits:provideraccount_list' provider_id=object.pk %} ``` ### Justification The `htmx_table` tag was introduced under #12538 to standardize and simplify our approach for embedding HTMX-backed object tables. Among other benefits, this ensures that the `return_url` parameter is passed correctly for every embedded table.
adam added the status: acceptedtype: housekeepingtopic: UI/UX labels 2025-12-29 20:33:06 +01:00
adam closed this issue 2025-12-29 20:33:06 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8148