django-smartbase-admin 1.0.19__py3-none-any.whl → 1.0.21__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- django_smartbase_admin/engine/dashboard.py +22 -20
- django_smartbase_admin/migrations/0006_alter_sbadminuserconfiguration_color_scheme.py +18 -0
- django_smartbase_admin/models.py +3 -14
- django_smartbase_admin/static/sb_admin/dist/calendar_style.css +1 -1
- django_smartbase_admin/static/sb_admin/dist/main.js +1 -1
- django_smartbase_admin/static/sb_admin/dist/main_style.css +1 -1
- django_smartbase_admin/static/sb_admin/src/css/_components.css +9 -0
- django_smartbase_admin/static/sb_admin/src/css/calendar.css +33 -1
- django_smartbase_admin/static/sb_admin/src/js/main.js +24 -19
- django_smartbase_admin/templates/sb_admin/actions/dashboard.html +1 -1
- django_smartbase_admin/templates/sb_admin/dashboard/calendar_widget.html +36 -2
- django_smartbase_admin/templates/sb_admin/dashboard/chart_widget.html +1 -1
- django_smartbase_admin/templates/sb_admin/dashboard/list_widget.html +6 -0
- django_smartbase_admin/templates/sb_admin/dashboard/widget_base.html +1 -1
- django_smartbase_admin/templates/sb_admin/filter_widgets/partials/clear.html +10 -5
- django_smartbase_admin/templates/sb_admin/navigation.html +5 -3
- {django_smartbase_admin-1.0.19.dist-info → django_smartbase_admin-1.0.21.dist-info}/METADATA +1 -1
- {django_smartbase_admin-1.0.19.dist-info → django_smartbase_admin-1.0.21.dist-info}/RECORD +20 -19
- {django_smartbase_admin-1.0.19.dist-info → django_smartbase_admin-1.0.21.dist-info}/LICENSE.md +0 -0
- {django_smartbase_admin-1.0.19.dist-info → django_smartbase_admin-1.0.21.dist-info}/WHEEL +0 -0
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
from copy import copy
|
|
2
2
|
from datetime import timedelta
|
|
3
|
-
|
|
4
3
|
from django.core.cache import cache
|
|
5
4
|
from django.db import models
|
|
6
5
|
from django.db.models import QuerySet
|
|
@@ -553,25 +552,28 @@ class SBAdminDashboardChartWidgetByDate(SBAdminDashboardChartWidget):
|
|
|
553
552
|
self.date_annotate_field
|
|
554
553
|
)
|
|
555
554
|
)
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
555
|
+
if date_range[0] and date_range[1]:
|
|
556
|
+
date_range_compare = date_range
|
|
557
|
+
if compare == self.CompareOptions.COMPARE_PREVIOUS:
|
|
558
|
+
period_length = (
|
|
559
|
+
date_range_compare[1] - date_range_compare[0]
|
|
560
|
+
).days + 1
|
|
561
|
+
date_range_compare[0] = date_range_compare[0] - timedelta(
|
|
562
|
+
days=period_length
|
|
563
|
+
)
|
|
564
|
+
date_range_compare[1] = date_range_compare[1] - timedelta(
|
|
565
|
+
days=period_length
|
|
566
|
+
)
|
|
567
|
+
if compare == self.CompareOptions.COMPARE_PREVIOUS_YOY:
|
|
568
|
+
date_range_compare[0] = date_range_compare[0].replace(
|
|
569
|
+
year=date_range_compare[0].year - 1
|
|
570
|
+
)
|
|
571
|
+
date_range_compare[1] = date_range_compare[1].replace(
|
|
572
|
+
year=date_range_compare[1].year - 1
|
|
573
|
+
)
|
|
574
|
+
request_data_modified_date_filter.request_get[
|
|
575
|
+
self.date_annotate_field
|
|
576
|
+
] = DateFilterWidget.get_value_from_date_or_range(date_range_compare)
|
|
575
577
|
queryset_with_modified_date = self.get_data_queryset(request_copy)
|
|
576
578
|
|
|
577
579
|
sub_widget_data = {}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Generated by Django 5.0.14 on 2025-08-04 06:22
|
|
2
|
+
|
|
3
|
+
from django.db import migrations, models
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Migration(migrations.Migration):
|
|
7
|
+
|
|
8
|
+
dependencies = [
|
|
9
|
+
('django_smartbase_admin', '0005_sbadminuserconfiguration'),
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
operations = [
|
|
13
|
+
migrations.AlterField(
|
|
14
|
+
model_name='sbadminuserconfiguration',
|
|
15
|
+
name='color_scheme',
|
|
16
|
+
field=models.CharField(choices=[('auto', 'System'), ('dark', 'Dark'), ('light', 'Light')], default='auto', max_length=255, verbose_name='Theme'),
|
|
17
|
+
),
|
|
18
|
+
]
|
django_smartbase_admin/models.py
CHANGED
|
@@ -1,25 +1,14 @@
|
|
|
1
1
|
from django.conf import settings
|
|
2
2
|
from django.db import models
|
|
3
|
-
from django.utils.html import format_html
|
|
4
3
|
from django.utils.translation import gettext_lazy as _
|
|
5
4
|
|
|
6
5
|
from django_smartbase_admin.querysets import SBAdminListViewConfigurationQueryset
|
|
7
6
|
|
|
8
|
-
AUTO_LABEL = _("System")
|
|
9
|
-
DARK_LABEL = _("Dark")
|
|
10
|
-
LIGHT_LABEL = _("Light")
|
|
11
|
-
|
|
12
7
|
|
|
13
8
|
class ColorScheme(models.TextChoices):
|
|
14
|
-
AUTO = "auto",
|
|
15
|
-
|
|
16
|
-
)
|
|
17
|
-
DARK = "dark", format_html(
|
|
18
|
-
f'<span class="flex gap-8"><svg class="w-20 h-20"><use href="#Moon"></use></svg><span>{DARK_LABEL}</span></span>'
|
|
19
|
-
)
|
|
20
|
-
LIGHT = "light", format_html(
|
|
21
|
-
f'<span class="flex gap-8"><svg class="w-20 h-20"><use href="#Sun-one"></use></svg><span>{LIGHT_LABEL}</span></span>'
|
|
22
|
-
)
|
|
9
|
+
AUTO = "auto", _("System")
|
|
10
|
+
DARK = "dark", _("Dark")
|
|
11
|
+
LIGHT = "light", _("Light")
|
|
23
12
|
|
|
24
13
|
|
|
25
14
|
class SBAdminListViewConfiguration(models.Model):
|
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--fc-small-font-size:.75rem;--fc-border-color:var(--color-dark-200);--fc-today-bg-color:var(--color-primary-50);--fc-neutral-bg-color:var(--color-bg-elevated)}.fc-theme-standard th.fc-col-header-cell{background-color:var(--color-bg);padding:.5rem 1.5rem}.fc-theme-standard td.fc-daygrid-day{padding:.5rem}.fc table{font-size:.75rem;line-height:1.25rem}.fc .fc-col-header-cell-cushion{font-size:.875rem;font-weight:500;line-height:1.25rem;padding:0}.fc .fc-daygrid-day{height:9rem}.fc .fc-day-other{background-color:var(--color-bg)}.fc .fc-day-other .fc-daygrid-day-top{opacity:1}.fc .fc-day-other .fc-daygrid-day-top .fc-daygrid-day-number{color:var(--color-dark)}.fc .fc-day-other .fc-daygrid-day-events{opacity:.6}.fc .fc-daygrid-day-bottom:after,.fc .fc-daygrid-day-bottom:before,.fc .fc-daygrid-day-events:after,.fc .fc-daygrid-day-events:before,.fc .fc-daygrid-day-frame:after,.fc .fc-daygrid-day-frame:before,.fc .fc-daygrid-event-harness:after,.fc .fc-daygrid-event-harness:before{display:none}.fc .fc-daygrid-day-events,.fc .fc-daygrid-day-frame{display:flex;flex-direction:column;gap:.25rem}.fc .fc-daygrid-day-events{margin:0}.fc .fc-daygrid-day-top{flex-direction:row}.fc .fc-daygrid-day-number{align-items:center;color:var(--color-dark-900);display:flex;font-weight:600;height:1.5rem;justify-content:center;line-height:1;padding:.25rem;width:1.5rem}.fc .fc-day-today .fc-daygrid-day-number{background-color:var(--color-primary);border-radius:9999px;color:var(--color-light)}.fc .fc-daygrid-event{display:flex;gap:.25rem;margin:0!important}.fc .fc-daygrid-dot-event{border-color:var(--color-dark-200);border-radius:6px;border-width:1px;height:1.5rem;padding:0 .5rem}.fc .fc-daygrid-dot-event .fc-event-time{display:none}.fc .fc-daygrid-dot-event .fc-event-title{color:var(--color-dark-900);font-weight:400;line-height:1rem;text-overflow:ellipsis}.fc .fc-daygrid-event-dot{border-color:currentColor;border-radius:9999px;border-width:2px;box-sizing:border-box;flex-shrink:0;height:.75rem;margin:0;width:.75rem}.fc .fc-daygrid-day-bottom{font-size:.75rem;line-height:1.25rem;margin:0!important}.fc .fc-daygrid-more-link{margin:0;padding:0}.fc .fc-daygrid-more-link:hover{background:none}.fc .fc-daygrid-body-unbalanced .fc-daygrid-day-events{margin-bottom:0;min-height:4rem}.fc .fc-daygrid-day-bg{display:none}.fc .fc-popover{z-index:10}.fc .fc-popover .fc-popover-header{padding:.25rem}.fc .fc-popover .fc-popover-title{font-size:.875rem;line-height:1.25rem}.fc .fc-popover .fc-popover-body{display:flex;flex-direction:column;gap:.25rem;padding:.5rem}.fc .fc-scrollgrid{border-left-width:0}.fc .fc-scrollgrid-section>td,.fc .fc-scrollgrid-section>th{border:0}
|
|
1
|
+
:root{--fc-small-font-size:.75rem;--fc-border-color:var(--color-dark-200);--fc-today-bg-color:var(--color-primary-50);--fc-neutral-bg-color:var(--color-bg);--fc-page-bg-color:var(--color-bg-elevated)}.fc-theme-standard th.fc-col-header-cell{background-color:var(--color-bg);padding:.5rem 1.5rem}.fc-theme-standard td.fc-daygrid-day{padding:.5rem}.fc table{font-size:.75rem;line-height:1.25rem}.fc .fc-col-header-cell-cushion{font-size:.875rem;font-weight:500;line-height:1.25rem;padding:0}.fc .fc-daygrid-day{height:9rem}.fc .fc-day-other{background-color:var(--color-bg)}.fc .fc-day-other .fc-daygrid-day-top{opacity:1}.fc .fc-day-other .fc-daygrid-day-top .fc-daygrid-day-number{color:var(--color-dark)}.fc .fc-day-other .fc-daygrid-day-events{opacity:.6}.fc .fc-daygrid-day-bottom:after,.fc .fc-daygrid-day-bottom:before,.fc .fc-daygrid-day-events:after,.fc .fc-daygrid-day-events:before,.fc .fc-daygrid-day-frame:after,.fc .fc-daygrid-day-frame:before,.fc .fc-daygrid-event-harness:after,.fc .fc-daygrid-event-harness:before{display:none}.fc .fc-daygrid-day-events,.fc .fc-daygrid-day-frame{display:flex;flex-direction:column;gap:.25rem}.fc .fc-daygrid-day-events{margin:0}.fc .fc-daygrid-day-top{flex-direction:row}.fc .fc-daygrid-day-number{align-items:center;color:var(--color-dark-900);display:flex;font-weight:600;height:1.5rem;justify-content:center;line-height:1;padding:.25rem;width:1.5rem}.fc .fc-day-today .fc-daygrid-day-number{background-color:var(--color-primary);border-radius:9999px;color:var(--color-light)}.fc .fc-day-today.fc-day-other .fc-daygrid-day-top .fc-daygrid-day-number{color:var(--color-light)}.fc .fc-daygrid-event{display:flex;gap:.25rem;margin:0!important}.fc .fc-daygrid-dot-event{border-color:var(--color-dark-200);border-radius:6px;border-width:1px;height:1.5rem;padding:0 .5rem}.fc .fc-daygrid-dot-event .fc-event-time{display:none}.fc .fc-daygrid-dot-event .fc-event-title{color:var(--color-dark-900);font-weight:400;line-height:1rem;text-overflow:ellipsis}.fc .fc-daygrid-dot-event.event-positive{background-color:var(--color-success-50);border-color:var(--color-success-200)}.fc .fc-daygrid-dot-event.event-positive .fc-daygrid-event-dot{border-color:var(--color-success)}.fc .fc-daygrid-dot-event.event-warning{background-color:var(--color-warning-50);border-color:var(--color-warning-200)}.fc .fc-daygrid-dot-event.event-warning .fc-daygrid-event-dot{border-color:var(--color-warning)}.fc .fc-daygrid-dot-event.event-negative{background-color:var(--color-negative-50);border-color:var(--color-negative-200)}.fc .fc-daygrid-dot-event.event-negative .fc-daygrid-event-dot{border-color:var(--color-negative)}.fc .fc-daygrid-dot-event.event-notice{background-color:var(--color-notice-50);border-color:var(--color-notice-200)}.fc .fc-daygrid-dot-event.event-notice .fc-daygrid-event-dot{border-color:var(--color-notice)}.fc .fc-daygrid-event-dot{border-color:currentColor;border-radius:9999px;border-width:2px;box-sizing:border-box;flex-shrink:0;height:.75rem;margin:0;width:.75rem}.fc .fc-daygrid-day-bottom{font-size:.75rem;line-height:1.25rem;margin:0!important}.fc .fc-daygrid-more-link{margin:0;padding:0}.fc .fc-daygrid-more-link:hover{background:none}.fc .fc-daygrid-body-unbalanced .fc-daygrid-day-events{margin-bottom:0;min-height:4rem}.fc .fc-daygrid-day-bg{display:none}.fc .fc-popover{z-index:10}.fc .fc-popover .fc-popover-header{padding:.25rem}.fc .fc-popover .fc-popover-title{font-size:.875rem;line-height:1.25rem}.fc .fc-popover .fc-popover-body{display:flex;flex-direction:column;gap:.25rem;padding:.5rem}.fc .fc-scrollgrid{border-left-width:0}.fc .fc-scrollgrid-section>td,.fc .fc-scrollgrid-section>th{border:0}
|