diff --git a/.gitignore b/.gitignore index a344568c0..1b23b0a2d 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ venv .direnv/ .envrc venv +.vscode diff --git a/debug_toolbar/panels/community.py b/debug_toolbar/panels/community.py new file mode 100644 index 000000000..82e24150b --- /dev/null +++ b/debug_toolbar/panels/community.py @@ -0,0 +1,13 @@ +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 + template = "debug_toolbar/panels/community.html" + title = _("Community") 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..9fa231f90 --- /dev/null +++ b/debug_toolbar/templates/debug_toolbar/panels/community.html @@ -0,0 +1,48 @@ +{% load i18n %} + +
+

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

+

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

+ + +
+
+

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

+

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

+ +
diff --git a/docs/changes.rst b/docs/changes.rst index 2f9973731..6a58f7e77 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -11,6 +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 ``CommunityPanel`` 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 ~~~~~~~~~ diff --git a/tests/panels/test_history.py b/tests/panels/test_history.py index fbc338ba9..980ec4a67 100644 --- a/tests/panels/test_history.py +++ b/tests/panels/test_history.py @@ -81,6 +81,7 @@ class HistoryViewsTestCase(IntegrationTestCase): "AlertsPanel", "CachePanel", "SignalsPanel", + "CommunityPanel", "ProfilingPanel", }