From 4cc074af9e1c363383c4c3382a9f75f0ed5665a2 Mon Sep 17 00:00:00 2001 From: andoriyaprashant Date: Wed, 2 Apr 2025 23:49:02 +0530 Subject: [PATCH 1/5] Added Community panel --- .gitignore | 1 + debug_toolbar/panels/community.py | 18 +++++++ debug_toolbar/settings.py | 1 + .../static/debug_toolbar/css/toolbar.css | 37 ++++++++++++++ .../debug_toolbar/panels/community.html | 48 +++++++++++++++++++ docs/changes.rst | 1 + docs/configuration.rst | 1 + docs/panels.rst | 7 +++ 8 files changed, 114 insertions(+) create mode 100644 debug_toolbar/panels/community.py create mode 100644 debug_toolbar/templates/debug_toolbar/panels/community.html diff --git a/.gitignore b/.gitignore index a344568c0..7b62da58a 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ venv .direnv/ .envrc venv +.vscode \ No newline at end of file diff --git a/debug_toolbar/panels/community.py b/debug_toolbar/panels/community.py new file mode 100644 index 000000000..412089f61 --- /dev/null +++ b/debug_toolbar/panels/community.py @@ -0,0 +1,18 @@ +from django.utils.translation import gettext_lazy as _ + +from debug_toolbar.panels import Panel + + +class CommunityPanel(Panel): + """ + A panel that provides links to the Django Debug Toolbar community. + """ + + is_async = True + + title = _("Community") + template = "debug_toolbar/panels/community.html" + + def process_request(self, request): + self.record_stats({"community": "community"}) + return super().process_request(request) diff --git a/debug_toolbar/settings.py b/debug_toolbar/settings.py index c0561524b..d6b9003b6 100644 --- a/debug_toolbar/settings.py +++ b/debug_toolbar/settings.py @@ -80,6 +80,7 @@ def get_config(): "debug_toolbar.panels.alerts.AlertsPanel", "debug_toolbar.panels.cache.CachePanel", "debug_toolbar.panels.signals.SignalsPanel", + "debug_toolbar.panels.community.CommunityPanel", "debug_toolbar.panels.redirects.RedirectsPanel", "debug_toolbar.panels.profiling.ProfilingPanel", ] diff --git a/debug_toolbar/static/debug_toolbar/css/toolbar.css b/debug_toolbar/static/debug_toolbar/css/toolbar.css index 43b432069..120b8958c 100644 --- a/debug_toolbar/static/debug_toolbar/css/toolbar.css +++ b/debug_toolbar/static/debug_toolbar/css/toolbar.css @@ -1182,3 +1182,40 @@ To regenerate: height: 1rem; width: 1rem; } + +#djDebug .djdt-community-panel { + padding: 1.5em; +} + +#djDebug .djdt-community-panel h2 { + font-size: 2em; +} + +#djDebug .djdt-community-panel p { + font-size: 1em; + margin: 0 0 1em 0; +} + +#djDebug .djdt-community-panel .djdt-community-description { + font-size: 1em; + margin: 0 0 1.5em 0; +} + +#djDebug .djdt-community-panel ul { + list-style-type: disc; + padding-left: 1.25em; + margin: 1em 0; +} + +#djDebug .djdt-community-panel li { + margin: 0.5em 0; +} + +#djDebug .djdt-community-panel a { + font-weight: bold; + font-size: 1em; +} + +#djDebug .djdt-community-panel a:hover { + text-decoration: underline; +} diff --git a/debug_toolbar/templates/debug_toolbar/panels/community.html b/debug_toolbar/templates/debug_toolbar/panels/community.html new file mode 100644 index 000000000..84df0513b --- /dev/null +++ b/debug_toolbar/templates/debug_toolbar/panels/community.html @@ -0,0 +1,48 @@ +{% load i18n %} + +
+

+ {% trans "Community & Contribution" %} +

+

+ {% trans "Want to contribute to Django Debug Toolbar? Get involved in our community!" %} +

+ + +
+
+

+ {% trans "Django Debug Toolbar Documentation" %} +

+

+ {% trans "Explore the official documentation to learn more about Django Debug Toolbar." %} +

+ +
diff --git a/docs/changes.rst b/docs/changes.rst index 569f88975..0bbaa0dd5 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -8,6 +8,7 @@ Pending * Removed logging about the toolbar failing to serialize a value into JSON. * Moved the the import statement of ``debug_toolbar.urls`` to within the if statement's scope on the installation documentation. +* Added ``Community Panel`` containing links to documentation and resources. 6.0.0 (2025-07-22) ------------------ diff --git a/docs/configuration.rst b/docs/configuration.rst index d02a54c01..46359da83 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -32,6 +32,7 @@ default value is:: 'debug_toolbar.panels.alerts.AlertsPanel', 'debug_toolbar.panels.cache.CachePanel', 'debug_toolbar.panels.signals.SignalsPanel', + 'debug_toolbar.panels.community.CommunityPanel', 'debug_toolbar.panels.redirects.RedirectsPanel', 'debug_toolbar.panels.profiling.ProfilingPanel', ] diff --git a/docs/panels.rst b/docs/panels.rst index a116bff1e..f2364ea7c 100644 --- a/docs/panels.rst +++ b/docs/panels.rst @@ -108,6 +108,13 @@ Signals List of signals and receivers. +Community +~~~~~~~~~ + +.. class:: debug_toolbar.panels.community.CommunityPanel + +A panel that provides links to the Django Debug Toolbar community. + Redirects ~~~~~~~~~ From 176fc4b76915cf29bdb5cfb079b3272eab525b63 Mon Sep 17 00:00:00 2001 From: andoriyaprashant Date: Thu, 3 Apr 2025 01:02:22 +0530 Subject: [PATCH 2/5] CommunityPanel --- tests/panels/test_history.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/panels/test_history.py b/tests/panels/test_history.py index 29e062da0..236073339 100644 --- a/tests/panels/test_history.py +++ b/tests/panels/test_history.py @@ -80,6 +80,7 @@ class HistoryViewsTestCase(IntegrationTestCase): "AlertsPanel", "CachePanel", "SignalsPanel", + "CommunityPanel", } def test_history_panel_integration_content(self): From 66fd160a65fa3da62f2ac9b1b03b4cce1d795507 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 12 Sep 2025 15:46:15 +0000 Subject: [PATCH 3/5] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .gitignore | 2 +- .../debug_toolbar/panels/community.html | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index 7b62da58a..1b23b0a2d 100644 --- a/.gitignore +++ b/.gitignore @@ -16,4 +16,4 @@ venv .direnv/ .envrc venv -.vscode \ No newline at end of file +.vscode diff --git a/debug_toolbar/templates/debug_toolbar/panels/community.html b/debug_toolbar/templates/debug_toolbar/panels/community.html index 84df0513b..9fa231f90 100644 --- a/debug_toolbar/templates/debug_toolbar/panels/community.html +++ b/debug_toolbar/templates/debug_toolbar/panels/community.html @@ -2,46 +2,46 @@

- {% trans "Community & Contribution" %} + {% translate "Community & Contribution" %}

- {% trans "Want to contribute to Django Debug Toolbar? Get involved in our community!" %} + {% translate "Want to contribute to Django Debug Toolbar? Get involved in our community!" %}



- {% trans "Django Debug Toolbar Documentation" %} + {% translate "Django Debug Toolbar Documentation" %}

- {% trans "Explore the official documentation to learn more about Django Debug Toolbar." %} + {% translate "Explore the official documentation to learn more about Django Debug Toolbar." %}

From b90178d95c15a70f86307dd2521c8b43828bf8a4 Mon Sep 17 00:00:00 2001 From: Tim Schilling Date: Fri, 12 Sep 2025 11:15:58 -0500 Subject: [PATCH 4/5] Remove unnecessary process_request method. --- debug_toolbar/panels/community.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/debug_toolbar/panels/community.py b/debug_toolbar/panels/community.py index 412089f61..82e24150b 100644 --- a/debug_toolbar/panels/community.py +++ b/debug_toolbar/panels/community.py @@ -9,10 +9,5 @@ class CommunityPanel(Panel): """ is_async = True - - title = _("Community") template = "debug_toolbar/panels/community.html" - - def process_request(self, request): - self.record_stats({"community": "community"}) - return super().process_request(request) + title = _("Community") From b5415e3fed384bfb33e8f86f2150ffe4d3f77210 Mon Sep 17 00:00:00 2001 From: Tim Schilling Date: Fri, 12 Sep 2025 11:16:54 -0500 Subject: [PATCH 5/5] Remove space from panel class name in changelog. --- docs/changes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changes.rst b/docs/changes.rst index 48eae8775..6a58f7e77 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -11,7 +11,7 @@ Pending * Changed ``StoredDebugToolbar.from_store`` to always create a panel key and class instance, regardless if any data was generated. * Fixed selenium tests for CI by using psycopg for Python 3.13 runs. -* Added ``Community Panel`` containing links to documentation and resources. +* Added ``CommunityPanel`` containing links to documentation and resources. 6.0.0 (2025-07-22) ------------------