Skip to content

Commit 7b0aa45

Browse files
andoriyaprashantalan-rosenberg
authored andcommitted
Added Community panel
1 parent 992ed5c commit 7b0aa45

File tree

6 files changed

+115
-0
lines changed

6 files changed

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

debug_toolbar/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ def get_config():
8282
"debug_toolbar.panels.signals.SignalsPanel",
8383
"debug_toolbar.panels.redirects.RedirectsPanel",
8484
"debug_toolbar.panels.profiling.ProfilingPanel",
85+
"debug_toolbar.panels.community.CommunityPanel",
8586
]
8687

8788

debug_toolbar/static/debug_toolbar/css/toolbar.css

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1182,3 +1182,48 @@ To regenerate:
11821182
height: 1rem;
11831183
width: 1rem;
11841184
}
1185+
1186+
#djDebug .djdt-community-panel {
1187+
padding: 20px;
1188+
}
1189+
1190+
#djDebug .djdt-community-panel h2 {
1191+
padding-bottom: 10px;
1192+
font-size: 22px;
1193+
margin: 0 0 15px 0;
1194+
}
1195+
1196+
#djDebug .djdt-community-panel h3 {
1197+
margin-top: 20px;
1198+
font-size: 20px;
1199+
margin-bottom: 10px;
1200+
}
1201+
1202+
#djDebug .djdt-community-panel p {
1203+
font-size: 18px;
1204+
margin: 0 0 15px 0;
1205+
}
1206+
1207+
#djDebug .djdt-community-panel .djdt-community-description {
1208+
font-size: 16px;
1209+
margin: 0 0 20px 0;
1210+
}
1211+
1212+
#djDebug .djdt-community-panel ul {
1213+
list-style-type: disc;
1214+
padding-left: 20px;
1215+
margin: 15px 0;
1216+
}
1217+
1218+
#djDebug .djdt-community-panel li {
1219+
margin: 5px 0;
1220+
}
1221+
1222+
#djDebug .djdt-community-panel a {
1223+
font-weight: bold;
1224+
font-size: 16px;
1225+
}
1226+
1227+
#djDebug .djdt-community-panel a:hover {
1228+
text-decoration: underline;
1229+
}
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-panelContent djdt-community-panel">
4+
<h2>
5+
{% trans "Community & Contribution" %}
6+
</h2>
7+
<hr>
8+
<p>
9+
{% trans "Want to contribute to Django Debug Toolbar? Get involved in our community!" %}
10+
</p>
11+
12+
<ul>
13+
<li>
14+
<a href="https://github.com/django-commons/django-debug-toolbar/discussions" target="_blank">
15+
{% trans "Join Discussions" %}
16+
</a>
17+
</li>
18+
<li>
19+
<a href="https://github.com/django-commons/django-debug-toolbar/issues" target="_blank">
20+
{% trans "View Issues" %}
21+
</a>
22+
</li>
23+
<li>
24+
<a href="https://django-debug-toolbar.readthedocs.io/en/latest/contributing.html" target="_blank">
25+
{% trans "Contribution Guide" %}
26+
</a>
27+
</li>
28+
</ul>
29+
<hr>
30+
<h3>
31+
{% trans "Django Debug Toolbar Documentation" %}
32+
</h3>
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
@@ -58,6 +58,7 @@ Pending
5858
conflicts
5959
* Added CSS for resetting the height of elements too to avoid problems with
6060
global CSS of a website where the toolbar is used.
61+
* Added Community panel
6162

6263
5.1.0 (2025-03-20)
6364
------------------

0 commit comments

Comments
 (0)