Skip to content

Commit 4cc074a

Browse files
andoriyaprashantalan-rosenberg
authored andcommitted
Added Community panel
1 parent 992ed5c commit 4cc074a

File tree

8 files changed

+114
-0
lines changed

8 files changed

+114
-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: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
13+
title = _("Community")
14+
template = "debug_toolbar/panels/community.html"
15+
16+
def process_request(self, request):
17+
self.record_stats({"community": "community"})
18+
return super().process_request(request)

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+
{% trans "Community & Contribution" %}
6+
</h2>
7+
<p>
8+
{% trans "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+
{% trans "Join Discussions" %}
15+
</a>
16+
</li>
17+
<li>
18+
<a href="https://github.com/django-commons/django-debug-toolbar/issues" target="_blank">
19+
{% trans "View Issues" %}
20+
</a>
21+
</li>
22+
<li>
23+
<a href="https://django-debug-toolbar.readthedocs.io/en/latest/contributing.html" target="_blank">
24+
{% trans "Contribution Guide" %}
25+
</a>
26+
</li>
27+
</ul>
28+
<hr>
29+
<br>
30+
<h2>
31+
{% trans "Django Debug Toolbar Documentation" %}
32+
</h2>
33+
<p class="djdt-community-description">
34+
{% trans "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+
{% trans "Read Documentation" %}
40+
</a>
41+
</li>
42+
<li>
43+
<a href="https://django-debug-toolbar.readthedocs.io/en/latest/resources.html" target="_blank">
44+
{% trans "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
@@ -8,6 +8,7 @@ Pending
88
* Removed logging about the toolbar failing to serialize a value into JSON.
99
* Moved the the import statement of ``debug_toolbar.urls`` to within the if
1010
statement's scope on the installation documentation.
11+
* Added ``Community Panel`` containing links to documentation and resources.
1112

1213
6.0.0 (2025-07-22)
1314
------------------

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

0 commit comments

Comments
 (0)