Skip to content

Commit d327431

Browse files
author
oko-x
committed
triv: show components page in case of debug
1 parent 1f4b986 commit d327431

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

src/django_smartbase_admin/admin/site.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
from functools import update_wrapper
22

3+
from django.conf import settings
34
from django.contrib import admin
45
from django.urls import path, reverse_lazy
6+
from django.views.generic import TemplateView
57

68
from django_smartbase_admin.engine.admin_entrypoint_view import SBAdminEntrypointView
79
from django_smartbase_admin.engine.request import SBAdminViewRequestData
@@ -129,6 +131,16 @@ def get_urls(self):
129131
name="password_reset_complete",
130132
),
131133
]
134+
if settings.DEBUG:
135+
urls.append(
136+
path(
137+
"components",
138+
TemplateView.as_view(
139+
template_name="sb_admin/includes/components.html"
140+
),
141+
name="components",
142+
)
143+
)
132144
for model, model_admin in self._registry.items():
133145
action_view = getattr(model_admin, "action_view", None)
134146
if not action_view:

src/django_smartbase_admin/templates/sb_admin/includes/components.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
{% extends 'sb_admin/sb_admin_base_no_sidebar.html' %}
2+
{% load i18n %}
3+
{% block main_wrapper %}
14
<div class="alert bg-notice-50 border border-notice-100 text-notice-900">
25
<div class="flex">
36
<svg class="w-20 h-20 mr-12 text-notice">
@@ -439,4 +442,5 @@ <h3 class="text-dark-900 text-18 font-semibold leading-28">title</h3>
439442
<div>
440443
<input type="text" id="date-picker" class="js-datepicker-range">
441444
</div>
442-
</div>
445+
</div>
446+
{% endblock %}

0 commit comments

Comments
 (0)