From 136217e9b2a9802e908024921dd48acea77c6beb Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Fri, 9 Feb 2024 15:16:45 -0500 Subject: [PATCH] Remove unused data template block & getNetboxData() utility function --- netbox/project-static/dist/netbox.js.map | Bin 339797 -> 339796 bytes netbox/project-static/src/util.ts | 23 ----------------------- netbox/templates/base/base.html | 5 ----- 3 files changed, 28 deletions(-) diff --git a/netbox/project-static/dist/netbox.js.map b/netbox/project-static/dist/netbox.js.map index 431f5e6260e73e327562a37c41ee7aa5c39ad6de..13a894708b18f1c6d08a0971b5eef300a60b738d 100644 GIT binary patch delta 38 ucmcb5Pvpuyk%kt=7N!>FEiBCvjK14jC0H6+m<*HJIb>P3bI7v#3IPBXgbSkp delta 39 vcmca|Pvq)7k%kt=7N!>FEiBCvOlD5oTO?Q-S(vg?+Sz4UwzJE!`U(L6Bfks> diff --git a/netbox/project-static/src/util.ts b/netbox/project-static/src/util.ts index e1ada2e19..3aa8b6676 100644 --- a/netbox/project-static/src/util.ts +++ b/netbox/project-static/src/util.ts @@ -244,29 +244,6 @@ export function getSelectedOptions( return selected; } -/** - * Get data that can only be accessed via Django context, and is thus already rendered in the HTML - * template. - * - * @see Templates requiring Django context data have a `{% block data %}` block. - * - * @param key Property name, which must exist on the HTML element. If not already prefixed with - * `data-`, `data-` will be prepended to the property. - * @returns Value if it exists, `null` if not. - */ -export function getNetboxData(key: string): string | null { - if (!key.startsWith('data-')) { - key = `data-${key}`; - } - for (const element of getElements('body > div#netbox-data > *')) { - const value = element.getAttribute(key); - if (isTruthy(value)) { - return value; - } - } - return null; -} - /** * Toggle visibility of an element. */ diff --git a/netbox/templates/base/base.html b/netbox/templates/base/base.html index b7d4f6fc6..1c58047ef 100644 --- a/netbox/templates/base/base.html +++ b/netbox/templates/base/base.html @@ -70,10 +70,5 @@ {# User messages #} {% include 'inc/messages.html' %} - {# Data container #} -
- {% block data %}{% endblock %} -
-