Skip to content

Commit 3c995da

Browse files
VeldaKiaratim-schilling
authored andcommitted
Update the design interface of the toolbar.
This includes the following: - The newly designed logo - Design documentation and guidelines for the documentation - Toolbar UI colours with the new theme - Credit to the designer for the work on docs - Accessibility audit and fixes
1 parent f307de1 commit 3c995da

97 files changed

Lines changed: 1175 additions & 73 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

biome.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/2.5.5/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/2.5.6/schema.json",
33
"formatter": {
44
"enabled": true,
55
"useEditorconfig": true

debug_toolbar/panels/__init__.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,13 @@ def enabled(self) -> bool:
5757

5858
# Titles and content
5959

60+
nav_icon = None
61+
"""
62+
Optional static path to an icon shown next to :attr:`nav_title` in the
63+
side bar, e.g. ``"debug_toolbar/img/history.svg"``. Defaults to ``None``
64+
(no icon).
65+
"""
66+
6067
@property
6168
def nav_title(self):
6269
"""
@@ -97,6 +104,15 @@ def title(self):
97104
"""
98105
raise NotImplementedError
99106

107+
@property
108+
def title_bar(self):
109+
"""
110+
Optional extra HTML rendered in the panel's title bar, next to the
111+
:attr:`title`. Useful for panel-specific controls such as buttons.
112+
Defaults to the empty string (nothing extra).
113+
"""
114+
return ""
115+
100116
@property
101117
def template(self):
102118
"""

debug_toolbar/panels/alerts.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ class AlertsPanel(Panel):
7575
}
7676

7777
title = _("Alerts")
78+
nav_icon = "debug_toolbar/img/alerts.svg"
7879

7980
is_async = True
8081

debug_toolbar/panels/cache.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ def _record_call(self, cache, alias, name, original_method, args, kwargs):
171171
# Implement the Panel API
172172

173173
nav_title = _("Cache")
174+
nav_icon = "debug_toolbar/img/cache.svg"
174175

175176
@property
176177
def nav_subtitle(self):

debug_toolbar/panels/community.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ class CommunityPanel(Panel):
1111
is_async = True
1212
template = "debug_toolbar/panels/community.html"
1313
title = _("Community")
14+
nav_icon = "debug_toolbar/img/community.svg"

debug_toolbar/panels/headers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class HeadersPanel(Panel):
2929
}
3030

3131
title = _("Headers")
32+
nav_icon = "debug_toolbar/img/headers.svg"
3233

3334
is_async = True
3435

debug_toolbar/panels/history/panel.py

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class HistoryPanel(Panel):
2020
is_async = True
2121
title = _("History")
2222
nav_title = _("History")
23+
nav_icon = "debug_toolbar/img/history.svg"
2324
template = "debug_toolbar/panels/history.html"
2425

2526
def get_headers(self, request: HttpRequest) -> dict:
@@ -52,6 +53,21 @@ def get_urls(cls) -> list[URLPattern]:
5253
def nav_subtitle(self) -> str:
5354
return self.get_stats().get("request_url", "")
5455

56+
@property
57+
def title_bar(self) -> str:
58+
"""Render the refresh control shown in the panel's title bar."""
59+
return render_to_string(
60+
"debug_toolbar/panels/history_title_bar.html",
61+
{
62+
"refresh_form": HistoryStoreForm(
63+
initial={
64+
"request_id": self.toolbar.request_id,
65+
"exclude_history": True,
66+
}
67+
),
68+
},
69+
)
70+
5571
def generate_stats(self, request: HttpRequest, response: HttpResponse) -> None:
5672
data: QueryDict | None = None
5773
try:
@@ -105,12 +121,6 @@ def content(self) -> str:
105121
{
106122
"current_request_id": self.toolbar.request_id,
107123
"toolbar_history": toolbar_history,
108-
"refresh_form": HistoryStoreForm(
109-
initial={
110-
"request_id": self.toolbar.request_id,
111-
"exclude_history": True,
112-
}
113-
),
114124
},
115125
)
116126

debug_toolbar/panels/profiling.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ class ProfilingPanel(Panel):
154154

155155
is_async = False
156156
title = _("Profiling")
157+
nav_icon = "debug_toolbar/img/profiling.svg"
157158

158159
template = "debug_toolbar/panels/profiling.html"
159160
capture_project_code = dt_settings.get_config()["PROFILER_CAPTURE_PROJECT_CODE"]

debug_toolbar/panels/redirects.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class RedirectsPanel(Panel):
1717
is_async = True
1818

1919
nav_title = _("Intercept redirects")
20+
nav_icon = "debug_toolbar/img/redirects.svg"
2021

2122
def _process_response(self, response):
2223
"""

debug_toolbar/panels/request.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ class RequestPanel(Panel):
1414
template = "debug_toolbar/panels/request.html"
1515

1616
title = _("Request")
17+
nav_icon = "debug_toolbar/img/request.svg"
1718

1819
@property
1920
def nav_subtitle(self):

0 commit comments

Comments
 (0)