mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-16 04:02:52 -06:00
Push HTMX URL to browser location
This commit is contained in:
parent
5c34a75032
commit
6dd6094088
@ -5,13 +5,23 @@
|
||||
{% if paginator.num_pages > 1 %}
|
||||
<div class="btn-group btn-group-sm" role="group" aria-label="Pages">
|
||||
{% if page.has_previous %}
|
||||
<a href="#" hx-get="{% querystring request page=page.previous_page_number %}" hx-target="#object_list" class="btn btn-outline-secondary">
|
||||
<a href="#"
|
||||
hx-get="{% querystring request page=page.previous_page_number %}"
|
||||
hx-target="#object_list"
|
||||
hx-push-url="true"
|
||||
class="btn btn-outline-secondary"
|
||||
>
|
||||
<i class="mdi mdi-chevron-double-left"></i>
|
||||
</a>
|
||||
{% endif %}
|
||||
{% for p in page.smart_pages %}
|
||||
{% if p %}
|
||||
<a href="#" hx-get="{% querystring request page=p %}" hx-target="#object_list" class="btn btn-outline-secondary{% if page.number == p %} active{% endif %}">
|
||||
<a href="#"
|
||||
hx-get="{% querystring request page=p %}"
|
||||
hx-target="#object_list"
|
||||
hx-push-url="true"
|
||||
class="btn btn-outline-secondary{% if page.number == p %} active{% endif %}"
|
||||
>
|
||||
{{ p }}
|
||||
</a>
|
||||
{% else %}
|
||||
@ -21,7 +31,12 @@
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% if page.has_next %}
|
||||
<a href="#" hx-get="{% querystring request page=page.next_page_number %}" hx-target="#object_list" class="btn btn-outline-secondary">
|
||||
<a href="#"
|
||||
hx-get="{% querystring request page=page.next_page_number %}"
|
||||
hx-target="#object_list"
|
||||
hx-push-url="true"
|
||||
class="btn btn-outline-secondary"
|
||||
>
|
||||
<i class="mdi mdi-chevron-double-right"></i>
|
||||
</a>
|
||||
{% endif %}
|
||||
@ -35,7 +50,14 @@
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
{% for n in page.paginator.get_page_lengths %}
|
||||
<li><a class="dropdown-item" href="#" hx-get="{% querystring request per_page=n %}" hx-target="#object_list">{{ n }}</a></li>
|
||||
<li>
|
||||
<a href="#"
|
||||
hx-get="{% querystring request per_page=n %}"
|
||||
hx-target="#object_list"
|
||||
hx-push-url="true"
|
||||
class="dropdown-item"
|
||||
>{{ n }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -6,7 +6,13 @@
|
||||
<tr>
|
||||
{% for column in table.columns %}
|
||||
{% if column.orderable %}
|
||||
<th {{ column.attrs.th.as_html }}><a href="{% querystring table.prefixed_order_by_field=column.order_by_alias.next %}" hx-get="{% querystring table.prefixed_order_by_field=column.order_by_alias.next %}" hx-target="#object_list">{{ column.header }}</a></th>
|
||||
<th {{ column.attrs.th.as_html }}>
|
||||
<a href="#"
|
||||
hx-get="{% querystring table.prefixed_order_by_field=column.order_by_alias.next %}"
|
||||
hx-target="#object_list"
|
||||
hx-push-url="true"
|
||||
>{{ column.header }}</a>
|
||||
</th>
|
||||
{% else %}
|
||||
<th {{ column.attrs.th.as_html }}>{{ column.header }}</th>
|
||||
{% endif %}
|
||||
|
Loading…
Reference in New Issue
Block a user