mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
* Enable HTMX rendering for embedded tables * Start converting embedded tables to use HTMX (WIP) * Additional table conversions (WIP) * Standardize HTMX usage for nested group models * Enable HTMX for additional emebedded tables * Fix HTMX table rendering for ObjectChildrenView * Standardize usage of inc/panel_table.html * Hide selection boxes in embedded tables
This commit is contained in:
committed by
jeremystretch
parent
f74a2536f1
commit
1a2dae3471
@@ -1,5 +1,19 @@
|
||||
from urllib.parse import urlparse
|
||||
|
||||
|
||||
def is_htmx(request):
|
||||
"""
|
||||
Returns True if the request was made by HTMX; False otherwise.
|
||||
"""
|
||||
return 'Hx-Request' in request.headers
|
||||
|
||||
|
||||
def is_embedded(request):
|
||||
"""
|
||||
Returns True if the request indicates that it originates from a URL different from
|
||||
the path being requested.
|
||||
"""
|
||||
hx_current_url = request.headers.get('HX-Current-URL', None)
|
||||
if not hx_current_url:
|
||||
return False
|
||||
return request.path != urlparse(hx_current_url).path
|
||||
|
Reference in New Issue
Block a user