From e4469e5709fa0b4151993285ebb33bf7ab761e7c Mon Sep 17 00:00:00 2001 From: Tom Hall Date: Sat, 26 Apr 2025 16:51:17 +0100 Subject: [PATCH 1/3] Swapped order of header and button html elements to prevent button becoming inacessible with external css --- debug_toolbar/static/debug_toolbar/js/utils.js | 2 +- .../templates/debug_toolbar/includes/panel_content.html | 2 +- debug_toolbar/templates/debug_toolbar/panels/sql_explain.html | 2 +- debug_toolbar/templates/debug_toolbar/panels/sql_profile.html | 2 +- debug_toolbar/templates/debug_toolbar/panels/sql_select.html | 2 +- .../templates/debug_toolbar/panels/template_source.html | 2 +- tests/panels/test_custom.py | 2 +- tests/panels/test_settings.py | 2 +- tests/test_integration.py | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/debug_toolbar/static/debug_toolbar/js/utils.js b/debug_toolbar/static/debug_toolbar/js/utils.js index c42963fe3..0cfa80474 100644 --- a/debug_toolbar/static/debug_toolbar/js/utils.js +++ b/debug_toolbar/static/debug_toolbar/js/utils.js @@ -90,7 +90,7 @@ function ajax(url, init) { }) .catch((error) => { const win = document.getElementById("djDebugWindow"); - win.innerHTML = `

${error.message}

`; + win.innerHTML = `

${error.message}

`; $$.show(win); throw error; }); diff --git a/debug_toolbar/templates/debug_toolbar/includes/panel_content.html b/debug_toolbar/templates/debug_toolbar/includes/panel_content.html index b0f4af704..d797421a5 100644 --- a/debug_toolbar/templates/debug_toolbar/includes/panel_content.html +++ b/debug_toolbar/templates/debug_toolbar/includes/panel_content.html @@ -3,8 +3,8 @@ {% if panel.has_content and panel.enabled %}
-

{{ panel.title }}

+
{% if toolbar.should_render_panels %} diff --git a/debug_toolbar/templates/debug_toolbar/panels/sql_explain.html b/debug_toolbar/templates/debug_toolbar/panels/sql_explain.html index f169c838f..b9ff2911d 100644 --- a/debug_toolbar/templates/debug_toolbar/panels/sql_explain.html +++ b/debug_toolbar/templates/debug_toolbar/panels/sql_explain.html @@ -1,7 +1,7 @@ {% load i18n %}
-

{% translate "SQL explained" %}

+
diff --git a/debug_toolbar/templates/debug_toolbar/panels/sql_profile.html b/debug_toolbar/templates/debug_toolbar/panels/sql_profile.html index 6c07640e0..d18a309c6 100644 --- a/debug_toolbar/templates/debug_toolbar/panels/sql_profile.html +++ b/debug_toolbar/templates/debug_toolbar/panels/sql_profile.html @@ -1,7 +1,7 @@ {% load i18n %}
-

{% translate "SQL profiled" %}

+
diff --git a/debug_toolbar/templates/debug_toolbar/panels/sql_select.html b/debug_toolbar/templates/debug_toolbar/panels/sql_select.html index 3667f8199..9360cde05 100644 --- a/debug_toolbar/templates/debug_toolbar/panels/sql_select.html +++ b/debug_toolbar/templates/debug_toolbar/panels/sql_select.html @@ -1,7 +1,7 @@ {% load i18n %}
-

{% translate "SQL selected" %}

+
diff --git a/debug_toolbar/templates/debug_toolbar/panels/template_source.html b/debug_toolbar/templates/debug_toolbar/panels/template_source.html index 6e52a6ab8..4d47fd3c3 100644 --- a/debug_toolbar/templates/debug_toolbar/panels/template_source.html +++ b/debug_toolbar/templates/debug_toolbar/panels/template_source.html @@ -1,7 +1,7 @@ {% load i18n %}
-

{% translate "Template source:" %} {{ template_name }}

+
diff --git a/tests/panels/test_custom.py b/tests/panels/test_custom.py index f13c4ef62..661a5cc53 100644 --- a/tests/panels/test_custom.py +++ b/tests/panels/test_custom.py @@ -33,8 +33,8 @@ def test_escapes_panel_title(self): """
-

Title with special chars &"'<>

+
diff --git a/tests/panels/test_settings.py b/tests/panels/test_settings.py index 5bf29d322..89b016dc0 100644 --- a/tests/panels/test_settings.py +++ b/tests/panels/test_settings.py @@ -24,8 +24,8 @@ def test_panel_title(self): """
-

Settings from None

+
diff --git a/tests/test_integration.py b/tests/test_integration.py index 88cd8f9ab..a431ba29f 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -812,7 +812,7 @@ def test_displays_server_error(self): debug_window = self.selenium.find_element(By.ID, "djDebugWindow") self.selenium.find_element(By.CLASS_NAME, "BuggyPanel").click() self.wait.until(EC.visibility_of(debug_window)) - self.assertEqual(debug_window.text, "»\n500: Internal Server Error") + self.assertEqual(debug_window.text, "500: Internal Server Error\n»") def test_toolbar_language_will_render_to_default_language_when_not_set(self): self.get("/regular/basic/") From 6a071fcc1b6ddf319d600f4da5c5b151d3723acf Mon Sep 17 00:00:00 2001 From: Tom Hall Date: Sat, 26 Apr 2025 17:08:07 +0100 Subject: [PATCH 2/3] Update pending changes in docs --- docs/changes.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/changes.rst b/docs/changes.rst index 9c9195623..dee644bf8 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -15,6 +15,7 @@ Pending template loaders. * Introduced `djade `__ to format Django templates. +* Swapped display order of panel header and close button to prevent style conflicts 5.1.0 (2025-03-20) ------------------ From e53e22b788f2a6d2d76ad1d6c4c2d41ac9f5d606 Mon Sep 17 00:00:00 2001 From: Tom Hall Date: Sat, 26 Apr 2025 17:28:59 +0100 Subject: [PATCH 3/3] fixup docs edit --- docs/changes.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/changes.rst b/docs/changes.rst index dee644bf8..e7cdbef0e 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -15,7 +15,8 @@ Pending template loaders. * Introduced `djade `__ to format Django templates. -* Swapped display order of panel header and close button to prevent style conflicts +* Swapped display order of panel header and close button to prevent style + conflicts 5.1.0 (2025-03-20) ------------------