Skip to content

Commit c0f4b5b

Browse files
committed
Add sub_tab to widget action props. Dark mode support.
1 parent cefe974 commit c0f4b5b

26 files changed

Lines changed: 702 additions & 288 deletions

File tree

docs/build.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ def read_cls_docstring(cls):
4444

4545
def get_versions():
4646
return [
47+
{
48+
"version": "0.4.7",
49+
"changes": [
50+
"Add sub_tab to widget action props.",
51+
"Dark mode support.",
52+
],
53+
},
4754
{
4855
"version": "0.4.6",
4956
"changes": [

docs/index.html

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,10 @@ <h4 class="title">FastAdmin</h4>
192192

193193
<ul class="nav flex-column">
194194

195+
<li class="nav-item">
196+
<a class="nav-link" href="#v0_4_7">v0.4.7</a>
197+
</li>
198+
195199
<li class="nav-item">
196200
<a class="nav-link" href="#v0_4_6">v0.4.6</a>
197201
</li>
@@ -375,7 +379,7 @@ <h1>FastAdmin | Documentation</h1>
375379
<div class="row">
376380
<div class="col-sm-6 col-lg-4">
377381
<ul class="list-unstyled">
378-
<li><strong>Version:</strong> 0.4.6</li>
382+
<li><strong>Version:</strong> 0.4.7</li>
379383
<li>
380384
<strong>Author:</strong>
381385
<a href="mailto:vsdudakov@gmail.com" target="_blank">
@@ -1043,6 +1047,7 @@ <h3>Registering Models</h3>
10431047
),
10441048
],
10451049
tab="Analytics",
1050+
sub_tab="Sales",
10461051
title="Sales over time",
10471052
description="Line chart of sales",
10481053
width=24,
@@ -1632,6 +1637,7 @@ <h3>Registering Models</h3>
16321637
),
16331638
],
16341639
tab="Analytics",
1640+
sub_tab="Sales",
16351641
title="Sales over time",
16361642
description="Line chart of sales",
16371643
width=24,
@@ -2069,6 +2075,7 @@ <h3>Registering Models</h3>
20692075
),
20702076
],
20712077
tab="Analytics",
2078+
sub_tab="Sales",
20722079
title="Sales over time",
20732080
description="Line chart of sales",
20742081
width=24,
@@ -2553,6 +2560,7 @@ <h3>Registering Models</h3>
25532560
),
25542561
],
25552562
tab="Analytics",
2563+
sub_tab="Sales",
25562564
title="Sales over time",
25572565
description="Line chart of sales",
25582566
width=24,
@@ -4108,6 +4116,7 @@ <h3>Registering Inlines</h3>
41084116
),
41094117
],
41104118
tab="Analytics",
4119+
sub_tab="Sales",
41114120
title="Sales over time",
41124121
description="Line chart of sales",
41134122
width=24,
@@ -4697,6 +4706,7 @@ <h3>Registering Inlines</h3>
46974706
),
46984707
],
46994708
tab="Analytics",
4709+
sub_tab="Sales",
47004710
title="Sales over time",
47014711
description="Line chart of sales",
47024712
width=24,
@@ -5134,6 +5144,7 @@ <h3>Registering Inlines</h3>
51345144
),
51355145
],
51365146
tab="Analytics",
5147+
sub_tab="Sales",
51375148
title="Sales over time",
51385149
description="Line chart of sales",
51395150
width=24,
@@ -5618,6 +5629,7 @@ <h3>Registering Inlines</h3>
56185629
),
56195630
],
56205631
tab="Analytics",
5632+
sub_tab="Sales",
56215633
title="Sales over time",
56225634
description="Line chart of sales",
56235635
width=24,
@@ -6198,6 +6210,7 @@ <h3>Methods and Attributes</h3>
61986210
function=None,
61996211
*,
62006212
tab: str = "Default",
6213+
sub_tab: str | None = None,
62016214
title: str = "Action",
62026215
description: str | None = None,
62036216
widget_action_type: WidgetActionType = WidgetActionType.Action,
@@ -6268,6 +6281,7 @@ <h3>Methods and Attributes</h3>
62686281
wrapped.widget_action_props = widget_action_props
62696282
wrapped.widget_action_filters = widget_action_filters
62706283
wrapped.tab = tab
6284+
wrapped.sub_tab = sub_tab
62716285
wrapped.title = title
62726286
wrapped.width = width
62736287
wrapped.max_height = max_height
@@ -6515,6 +6529,49 @@ <h2>Changelog</h2>
65156529

65166530

65176531

6532+
<section id="v0_4_7">
6533+
<h3>v0.4.7</h3>
6534+
6535+
6536+
6537+
<p class="text-4">
6538+
Add sub_tab to widget action props.
6539+
</p>
6540+
6541+
6542+
6543+
6544+
6545+
6546+
6547+
6548+
6549+
6550+
6551+
6552+
6553+
6554+
6555+
<p class="text-4">
6556+
Dark mode support.
6557+
</p>
6558+
6559+
6560+
6561+
6562+
6563+
6564+
6565+
6566+
6567+
6568+
6569+
6570+
6571+
6572+
</section>
6573+
6574+
65186575
<section id="v0_4_6">
65196576
<h3>v0.4.6</h3>
65206577

examples/django_djangoorm/orm/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ def get_options() -> list:
181181
),
182182
],
183183
tab="Analytics",
184+
sub_tab="Sales",
184185
title="Sales over time",
185186
description="Line chart of sales",
186187
width=24,

examples/fastapi_ponyorm/example.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ def get_options() -> list:
135135
),
136136
],
137137
tab="Analytics",
138+
sub_tab="Sales",
138139
title="Sales over time",
139140
description="Line chart of sales",
140141
width=24,

examples/fastapi_sqlalchemy/example.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ async def pre_generate_models_schema(self) -> None:
134134
),
135135
],
136136
tab="Analytics",
137+
sub_tab="Sales",
137138
title="Sales over time",
138139
description="Line chart of sales",
139140
width=24,

examples/fastapi_tortoiseorm/example.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ async def pre_generate_models_schema(self) -> None:
145145
),
146146
],
147147
tab="Analytics",
148+
sub_tab="Sales",
148149
title="Sales over time",
149150
description="Line chart of sales",
150151
width=24,

fastadmin/models/decorators.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ def widget_action(
6161
function=None,
6262
*,
6363
tab: str = "Default",
64+
sub_tab: str | None = None,
6465
title: str = "Action",
6566
description: str | None = None,
6667
widget_action_type: WidgetActionType = WidgetActionType.Action,
@@ -131,6 +132,7 @@ def decorator(func):
131132
wrapped.widget_action_props = widget_action_props
132133
wrapped.widget_action_filters = widget_action_filters
133134
wrapped.tab = tab
135+
wrapped.sub_tab = sub_tab
134136
wrapped.title = title
135137
wrapped.width = width
136138
wrapped.max_height = max_height

fastadmin/models/helpers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ async def generate_models_schema(
244244
name=widget_action,
245245
title=widget_action_function.title,
246246
tab=widget_action_function.tab,
247+
sub_tab=widget_action_function.sub_tab,
247248
width=widget_action_function.width,
248249
max_height=getattr(widget_action_function, "max_height", None),
249250
description=getattr(widget_action_function, "short_description", None),

fastadmin/models/schemas.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ class ModelWidgetAction:
123123
title: str
124124
description: str | None
125125
tab: str
126+
sub_tab: str | None
126127
width: int | None
127128
max_height: int | None
128129
widget_action_type: WidgetActionType

fastadmin/static/index.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)