Skip to content

Commit d717797

Browse files
alan-rosenbergandoriyaprashantmatthiasktim-schilling
authored
Add Community Panel (#2193)
* Added Community panel to provide links to toolbar documentation and resources --------- Co-authored-by: andoriyaprashant <[email protected]> Co-authored-by: Matthias Kestenholz <[email protected]> Co-authored-by: Tim Schilling <[email protected]>
1 parent 4f8be05 commit d717797

File tree

9 files changed

+110
-0
lines changed

9 files changed

+110
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ venv
1616
.direnv/
1717
.envrc
1818
venv
19+
.vscode

debug_toolbar/panels/community.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from django.utils.translation import gettext_lazy as _
2+
3+
from debug_toolbar.panels import Panel
4+
5+
6+
class CommunityPanel(Panel):
7+
"""
8+
A panel that provides links to the Django Debug Toolbar community.
9+
"""
10+
11+
is_async = True
12+
template = "debug_toolbar/panels/community.html"
13+
title = _("Community")

debug_toolbar/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ def get_config():
8080
"debug_toolbar.panels.alerts.AlertsPanel",
8181
"debug_toolbar.panels.cache.CachePanel",
8282
"debug_toolbar.panels.signals.SignalsPanel",
83+
"debug_toolbar.panels.community.CommunityPanel",
8384
"debug_toolbar.panels.redirects.RedirectsPanel",
8485
"debug_toolbar.panels.profiling.ProfilingPanel",
8586
]

debug_toolbar/static/debug_toolbar/css/toolbar.css

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1182,3 +1182,40 @@ To regenerate:
11821182
height: 1rem;
11831183
width: 1rem;
11841184
}
1185+
1186+
#djDebug .djdt-community-panel {
1187+
padding: 1.5em;
1188+
}
1189+
1190+
#djDebug .djdt-community-panel h2 {
1191+
font-size: 2em;
1192+
}
1193+
1194+
#djDebug .djdt-community-panel p {
1195+
font-size: 1em;
1196+
margin: 0 0 1em 0;
1197+
}
1198+
1199+
#djDebug .djdt-community-panel .djdt-community-description {
1200+
font-size: 1em;
1201+
margin: 0 0 1.5em 0;
1202+
}
1203+
1204+
#djDebug .djdt-community-panel ul {
1205+
list-style-type: disc;
1206+
padding-left: 1.25em;
1207+
margin: 1em 0;
1208+
}
1209+
1210+
#djDebug .djdt-community-panel li {
1211+
margin: 0.5em 0;
1212+
}
1213+
1214+
#djDebug .djdt-community-panel a {
1215+
font-weight: bold;
1216+
font-size: 1em;
1217+
}
1218+
1219+
#djDebug .djdt-community-panel a:hover {
1220+
text-decoration: underline;
1221+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{% load i18n %}
2+
3+
<div class="djdt-community-panel">
4+
<h2>
5+
{% translate "Community & Contribution" %}
6+
</h2>
7+
<p>
8+
{% translate "Want to contribute to Django Debug Toolbar? Get involved in our community!" %}
9+
</p>
10+
11+
<ul>
12+
<li>
13+
<a href="https://github.com/django-commons/django-debug-toolbar/discussions" target="_blank">
14+
{% translate "Join Discussions" %}
15+
</a>
16+
</li>
17+
<li>
18+
<a href="https://github.com/django-commons/django-debug-toolbar/issues" target="_blank">
19+
{% translate "View Issues" %}
20+
</a>
21+
</li>
22+
<li>
23+
<a href="https://django-debug-toolbar.readthedocs.io/en/latest/contributing.html" target="_blank">
24+
{% translate "Contribution Guide" %}
25+
</a>
26+
</li>
27+
</ul>
28+
<hr>
29+
<br>
30+
<h2>
31+
{% translate "Django Debug Toolbar Documentation" %}
32+
</h2>
33+
<p class="djdt-community-description">
34+
{% translate "Explore the official documentation to learn more about Django Debug Toolbar." %}
35+
</p>
36+
<ul>
37+
<li>
38+
<a href="https://django-debug-toolbar.readthedocs.io/en/latest/" target="_blank">
39+
{% translate "Read Documentation" %}
40+
</a>
41+
</li>
42+
<li>
43+
<a href="https://django-debug-toolbar.readthedocs.io/en/latest/resources.html" target="_blank">
44+
{% translate "How to Use Django Debug Toolbar" %}
45+
</a>
46+
</li>
47+
</ul>
48+
</div>

docs/changes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Pending
1111
* Changed ``StoredDebugToolbar.from_store`` to always create a panel key and
1212
class instance, regardless if any data was generated.
1313
* Fixed selenium tests for CI by using psycopg for Python 3.13 runs.
14+
* Added ``CommunityPanel`` containing links to documentation and resources.
1415

1516
6.0.0 (2025-07-22)
1617
------------------

docs/configuration.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ default value is::
3232
'debug_toolbar.panels.alerts.AlertsPanel',
3333
'debug_toolbar.panels.cache.CachePanel',
3434
'debug_toolbar.panels.signals.SignalsPanel',
35+
'debug_toolbar.panels.community.CommunityPanel',
3536
'debug_toolbar.panels.redirects.RedirectsPanel',
3637
'debug_toolbar.panels.profiling.ProfilingPanel',
3738
]

docs/panels.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,13 @@ Signals
108108

109109
List of signals and receivers.
110110

111+
Community
112+
~~~~~~~~~
113+
114+
.. class:: debug_toolbar.panels.community.CommunityPanel
115+
116+
A panel that provides links to the Django Debug Toolbar community.
117+
111118
Redirects
112119
~~~~~~~~~
113120

tests/panels/test_history.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ class HistoryViewsTestCase(IntegrationTestCase):
8181
"AlertsPanel",
8282
"CachePanel",
8383
"SignalsPanel",
84+
"CommunityPanel",
8485
"ProfilingPanel",
8586
}
8687

0 commit comments

Comments
 (0)