django-unfold 0.21.1__py3-none-any.whl → 0.23.0__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- {django_unfold-0.21.1.dist-info → django_unfold-0.23.0.dist-info}/LICENSE.md +1 -1
- {django_unfold-0.21.1.dist-info → django_unfold-0.23.0.dist-info}/METADATA +26 -2
- {django_unfold-0.21.1.dist-info → django_unfold-0.23.0.dist-info}/RECORD +38 -38
- unfold/admin.py +29 -22
- unfold/apps.py +5 -0
- unfold/checks.py +1 -1
- unfold/contrib/filters/apps.py +1 -0
- unfold/contrib/forms/apps.py +1 -0
- unfold/contrib/guardian/apps.py +1 -1
- unfold/contrib/import_export/apps.py +1 -1
- unfold/forms.py +6 -1
- unfold/sites.py +4 -4
- unfold/static/unfold/css/styles.css +1 -1
- unfold/styles.css +15 -4
- unfold/templates/admin/actions.html +9 -9
- unfold/templates/admin/app_list.html +6 -14
- unfold/templates/admin/base.html +2 -4
- unfold/templates/admin/change_form.html +1 -2
- unfold/templates/admin/change_list.html +3 -3
- unfold/templates/admin/change_list_results.html +17 -5
- unfold/templates/admin/edit_inline/tabular.html +3 -3
- unfold/templates/admin/login.html +9 -5
- unfold/templates/admin/search_form.html +10 -12
- unfold/templates/unfold/helpers/account_links.html +2 -2
- unfold/templates/unfold/helpers/app_list.html +5 -1
- unfold/templates/unfold/helpers/display_label.html +2 -0
- unfold/templates/unfold/helpers/tab_list.html +1 -1
- unfold/templates/unfold/layouts/base_simple.html +1 -1
- unfold/templates/unfold/widgets/date.html +1 -1
- unfold/templates/{admin → unfold}/widgets/related_widget_wrapper.html +4 -4
- unfold/templates/unfold/widgets/time.html +1 -1
- unfold/templatetags/unfold_list.py +63 -48
- unfold/widgets.py +16 -3
- {django_unfold-0.21.1.dist-info → django_unfold-0.23.0.dist-info}/WHEEL +0 -0
- /unfold/templates/{admin → unfold}/widgets/clearable_file_input.html +0 -0
- /unfold/templates/{admin → unfold}/widgets/radio.html +0 -0
- /unfold/templates/{admin → unfold}/widgets/radio_option.html +0 -0
- /unfold/templates/{admin → unfold}/widgets/split_datetime.html +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: django-unfold
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.23.0
|
4
4
|
Summary: Modern Django admin theme for seamless interface development
|
5
5
|
Home-page: https://unfoldadmin.com
|
6
6
|
License: MIT
|
@@ -59,6 +59,8 @@ Did you decide to start using Unfold but you don't have time to make the switch
|
|
59
59
|
- **Colors:** possibility to override default color scheme
|
60
60
|
- **Third party packages:** default support for multiple popular applications
|
61
61
|
- **Environment label**: distinguish between environments by displaying a label
|
62
|
+
- **Parallel admin**: support for having default admin in parallel with Unfold
|
63
|
+
- **VS Code**: project configuration and development container is included
|
62
64
|
|
63
65
|
## Table of contents <!-- omit from toc -->
|
64
66
|
|
@@ -94,6 +96,9 @@ Did you decide to start using Unfold but you don't have time to make the switch
|
|
94
96
|
- [Pre-commit](#pre-commit)
|
95
97
|
- [Poetry configuration](#poetry-configuration)
|
96
98
|
- [Compiling Tailwind](#compiling-tailwind)
|
99
|
+
- [Using VS Code with containers](#using-vs-code-with-containers)
|
100
|
+
- [Development server](#development-server)
|
101
|
+
- [Compiling Tailwind in devcontainer](#compiling-tailwind-in-devcontainer)
|
97
102
|
- [Credits](#credits)
|
98
103
|
|
99
104
|
## Installation
|
@@ -704,6 +709,10 @@ class CrontabScheduleAdmin(ModelAdmin):
|
|
704
709
|
@admin.register(SolarSchedule)
|
705
710
|
class SolarScheduleAdmin(ModelAdmin):
|
706
711
|
pass
|
712
|
+
|
713
|
+
@admin.register(ClockedSchedule)
|
714
|
+
class ClockedScheduleAdmin(ModelAdmin):
|
715
|
+
pass
|
707
716
|
```
|
708
717
|
|
709
718
|
### django-guardian
|
@@ -733,7 +742,7 @@ When implementing `import_export.admin.ExportActionModelAdmin` class in admin pa
|
|
733
742
|
admin.py
|
734
743
|
|
735
744
|
from unfold.admin import ModelAdmin
|
736
|
-
from unfold.contrib.import_export import ExportActionModelAdmin
|
745
|
+
from unfold.contrib.import_export.admin import ExportActionModelAdmin
|
737
746
|
|
738
747
|
class ExampleAdmin(ModelAdmin, ExportActionModelAdmin):
|
739
748
|
pass
|
@@ -989,6 +998,7 @@ Before adding any source code, it is recommended to have pre-commit installed on
|
|
989
998
|
pip install pre-commit
|
990
999
|
pre-commit install
|
991
1000
|
pre-commit install --hook-type commit-msg
|
1001
|
+
pre-commit run --all-files # Check if everything is okay
|
992
1002
|
```
|
993
1003
|
|
994
1004
|
### Poetry configuration
|
@@ -1016,6 +1026,20 @@ Some components like datepickers, calendars or selectors in admin was not possib
|
|
1016
1026
|
|
1017
1027
|
**Note:** most of the custom styles located in style.css are created via `@apply some-tailwind-class;` as is not possible to manually add CSS class to element which are for example created via jQuery.
|
1018
1028
|
|
1029
|
+
### Using VS Code with containers
|
1030
|
+
|
1031
|
+
Unfold already contains prepared support for VS Code development. After cloning the project locally, open the main folder in VS Code (in terminal `code .`). Immediately, you would see a message from VS Code **Folder contains a Dev Container configuration file. Reopen folder to develop in a container** which will inform you that the support for containers is prepared. Confirm the message by clicking on **Reopen in Container**. If the message is not there, you can still manually open the project in a container by running the command **Dev Containers: Reopen in Container**.
|
1032
|
+
|
1033
|
+
#### Development server
|
1034
|
+
|
1035
|
+
Now the VS Code will build an image and install Python dependencies. After successful installation is completed, VS Code will spin a container and from now it is possible to directly develop in the container. Unfold contains an example development application with the basic Unfold configuration available under `tests/server`. Run `python manage.py runserver` within a `tests/server` folder to start a development Django server. Note that you have to run the command from VS Code terminal which is already connected to the running container.
|
1036
|
+
|
1037
|
+
**Note:** this is not a production ready server. Use it just for running tests or developing features & fixes.
|
1038
|
+
|
1039
|
+
#### Compiling Tailwind in devcontainer
|
1040
|
+
|
1041
|
+
The container has already a node preinstalled so it is possible to compile a new CSS. Open the terminal and run `npm install` which will install all dependencies and will create `node_modules` folder. Now, you can run npm commands for Tailwind as described in the previous chapter.
|
1042
|
+
|
1019
1043
|
## Credits
|
1020
1044
|
|
1021
1045
|
- [TailwindCSS](https://tailwindcss.com/) - CSS framework
|
@@ -1,11 +1,11 @@
|
|
1
1
|
unfold/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
-
unfold/admin.py,sha256=
|
3
|
-
unfold/apps.py,sha256=
|
4
|
-
unfold/checks.py,sha256=
|
2
|
+
unfold/admin.py,sha256=JjfiJhWSdhDBMK3cf6IsCyGwv5povQgAZtzeHWKrEtA,23792
|
3
|
+
unfold/apps.py,sha256=SlBXPYrUd2uXn67qFbRvbXSUk3XFWrF4-5WELgDCvho,381
|
4
|
+
unfold/checks.py,sha256=Smgji9w19hnYjJElJ_FJnnyTEAE-E-OUB6otHu7lasY,1670
|
5
5
|
unfold/contrib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
6
|
unfold/contrib/filters/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
7
7
|
unfold/contrib/filters/admin.py,sha256=7FJl86b407ylTjgkRN2EwXGHnnVNwBiGvA1_822L5uc,16412
|
8
|
-
unfold/contrib/filters/apps.py,sha256=
|
8
|
+
unfold/contrib/filters/apps.py,sha256=wEySJy0gMLzFLb9XNKE-RexiO05X7NaQ5QmxZyziJ_k,136
|
9
9
|
unfold/contrib/filters/forms.py,sha256=-Tv1vWh-u8eLPAJqSX6c8R3IY0GmgOoFrzVQ8E8gO_s,4055
|
10
10
|
unfold/contrib/filters/static/unfold/filters/css/nouislider.min.css,sha256=rddL_jOGGVEY6wR-aw0VYovAfz5fPeAIsulrlSNb1hc,4221
|
11
11
|
unfold/contrib/filters/static/unfold/filters/js/DateTimeShortcuts.js,sha256=jgFNBDf6aHvUlyv0LEDHggXO-xA8pWOCWFWcVupdA30,19332
|
@@ -18,7 +18,7 @@ unfold/contrib/filters/templates/unfold/filters/filters_numeric_range.html,sha25
|
|
18
18
|
unfold/contrib/filters/templates/unfold/filters/filters_numeric_single.html,sha256=3njmCOx1HLNBz6VWDQtBWXwBUcclY2Y3D1vRVTwNn8c,576
|
19
19
|
unfold/contrib/filters/templates/unfold/filters/filters_numeric_slider.html,sha256=LqN3D483HbeT33SI4Uoy8YxKLP0uWbKyt8_bi1EWz3w,1681
|
20
20
|
unfold/contrib/forms/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
21
|
-
unfold/contrib/forms/apps.py,sha256
|
21
|
+
unfold/contrib/forms/apps.py,sha256=Di0TMzVuRpVxLG-8Bjdq5ALCSf5r7u2xVhD0jU6H5Sc,132
|
22
22
|
unfold/contrib/forms/static/unfold/forms/css/trix.css,sha256=TH9WdnaZrmwI8hAEydwjobdrBzSw_KYdRTSQDuD-8hE,20027
|
23
23
|
unfold/contrib/forms/static/unfold/forms/js/trix.config.js,sha256=spkNBlJVk_pqido_rM6yywQxkJ3Kqb7DMLiBgpKksdA,858
|
24
24
|
unfold/contrib/forms/static/unfold/forms/js/trix.js,sha256=Pao0XiVeDiRawfTkGDg_np6CxB-oXPrUDI9akWc87oc,174157
|
@@ -26,7 +26,7 @@ unfold/contrib/forms/templates/unfold/forms/helpers/toolbar.html,sha256=yS8Zy-Ur
|
|
26
26
|
unfold/contrib/forms/templates/unfold/forms/wysiwyg.html,sha256=4ZefV6XrjJlUczcuSw8BhvMJUFSZPSXo1IkgkBivh5g,351
|
27
27
|
unfold/contrib/forms/widgets.py,sha256=_81_fsvK-yEsFIqLU59BTIIs2KAJk61pLs7J9sNi1G0,962
|
28
28
|
unfold/contrib/guardian/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
29
|
-
unfold/contrib/guardian/apps.py,sha256=
|
29
|
+
unfold/contrib/guardian/apps.py,sha256=ObJqwh4vHxkD4XfduP5IQAiYiWZxsXUOUqF1_R1GsRI,136
|
30
30
|
unfold/contrib/guardian/templates/admin/guardian/model/change_form.html,sha256=FSJc4MYYWyzZAy8Ay0b7Ov-cUo-oELHOM5fQehM54Lg,403
|
31
31
|
unfold/contrib/guardian/templates/admin/guardian/model/field.html,sha256=V9ZgmYiIQAFy3GC464y0iBOHm3SDvEEymbuhT3S0qKU,296
|
32
32
|
unfold/contrib/guardian/templates/admin/guardian/model/obj_perms_manage.html,sha256=p7GmZOyDqj1urDAh9pyZhatnSpe-G6gXtQ_DpRK-J8k,1426
|
@@ -36,7 +36,7 @@ unfold/contrib/guardian/templates/unfold/guardian/group_form.html,sha256=P8WMC5E
|
|
36
36
|
unfold/contrib/guardian/templates/unfold/guardian/user_form.html,sha256=ci7FRrhTEKbFKKxsJ-07_dWXBYz4mqXPoqu5HfqYLaM,4132
|
37
37
|
unfold/contrib/import_export/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
38
38
|
unfold/contrib/import_export/admin.py,sha256=73Jz93HtENiZe7jzuKSPl4JvasXCpDSGZw_9LvJ2QCU,1156
|
39
|
-
unfold/contrib/import_export/apps.py,sha256=
|
39
|
+
unfold/contrib/import_export/apps.py,sha256=SdJu6Qh90VqGWY19FSDhhpUqhTbaIYsJKny3zX5baHI,149
|
40
40
|
unfold/contrib/import_export/forms.py,sha256=dLqLv7YP0i8_CrxupEfh3VncJ8CJHf7O1eQoWFOcydU,672
|
41
41
|
unfold/contrib/import_export/templates/admin/import_export/base.html,sha256=loL2qcV-f8aAzkHss_I4IkwfgemVW2CjOu_aiBxdwX0,357
|
42
42
|
unfold/contrib/import_export/templates/admin/import_export/change_list_export_item.html,sha256=pTDeqPKOlCPKH2dxMIfPnWuc2wVDzB7AzL73WbxSnRY,257
|
@@ -58,10 +58,10 @@ unfold/contrib/simple_history/templates/simple_history/submit_line.html,sha256=n
|
|
58
58
|
unfold/dataclasses.py,sha256=JJdGYzQ8MpeOe2FQPJqrMn_UJcxUz1VJgHCuCtkZCA8,199
|
59
59
|
unfold/decorators.py,sha256=BVDlxhZxB4ND3f5-5oiENRTv_W_Q_Eu-gZlsrYKOxiU,3272
|
60
60
|
unfold/exceptions.py,sha256=gcCj1ox61E137bk_0Cqy4YC3SttdPgB-fiJUqpmyHSE,43
|
61
|
-
unfold/forms.py,sha256=
|
61
|
+
unfold/forms.py,sha256=SzdyBC5wqE5IcoZWS2oXObycmfmICHsqlS3X03mw4QA,3468
|
62
62
|
unfold/settings.py,sha256=--TdTSWdOA8TQGW4-vjJkjy_zEyd_kZwBr3BIuQ8hzI,1208
|
63
|
-
unfold/sites.py,sha256=
|
64
|
-
unfold/static/unfold/css/styles.css,sha256=
|
63
|
+
unfold/sites.py,sha256=Gy_i43j2nizW2g8-mas5icvtk-beKism_CznATW6Ia8,12586
|
64
|
+
unfold/static/unfold/css/styles.css,sha256=DjRQV4lwg81SmOyR1YRs1QWHNA0FdV7XYRiYP33lTig,91399
|
65
65
|
unfold/static/unfold/fonts/inter/Inter-Bold.woff2,sha256=O88EyjAeRPE_QEyKBKpK5wf2epUOEu8wwjj5bnhCZqE,46552
|
66
66
|
unfold/static/unfold/fonts/inter/Inter-Medium.woff2,sha256=O88EyjAeRPE_QEyKBKpK5wf2epUOEu8wwjj5bnhCZqE,46552
|
67
67
|
unfold/static/unfold/fonts/inter/Inter-Regular.woff2,sha256=O88EyjAeRPE_QEyKBKpK5wf2epUOEu8wwjj5bnhCZqE,46552
|
@@ -74,39 +74,34 @@ unfold/static/unfold/js/alpine.persist.js,sha256=84PZYnPi25AFm7wIWRe1gzA74c5Rv2V
|
|
74
74
|
unfold/static/unfold/js/app.js,sha256=CIitJoFqpeZYPw8icGVXYX9tVRUgqFxcPZ2WjWS8Ylk,5288
|
75
75
|
unfold/static/unfold/js/chart.js,sha256=22W6cFERR-CElMOKRgMMicueMVP0Vf7FBEBYH8Z8tCk,200633
|
76
76
|
unfold/static/unfold/js/htmx.js,sha256=XOLqvnZiyEx46EW9vaJTBUaaWg8CGVVfXJkVsUmJbpI,42820
|
77
|
-
unfold/styles.css,sha256=
|
78
|
-
unfold/templates/admin/actions.html,sha256=
|
77
|
+
unfold/styles.css,sha256=dlTJBzFvZEfH9xSs2AJ9nfzYTnxf8muCMa8COifqmzU,17598
|
78
|
+
unfold/templates/admin/actions.html,sha256=1tVlUpLoM72K2Ew4vQGcRwPjHuAtO5Jm4QdDsDLOq0I,2625
|
79
79
|
unfold/templates/admin/app_index.html,sha256=lVjMIFsspHQ09LGHKfdfg7TlqlL39AX5LbwoeoZjFhk,1335
|
80
|
-
unfold/templates/admin/app_list.html,sha256=
|
80
|
+
unfold/templates/admin/app_list.html,sha256=7u2Ex0ArdC0CJNCTDnTEZpAXI_xbNQ1nrzAH4BuInNA,3009
|
81
81
|
unfold/templates/admin/auth/user/add_form.html,sha256=iLig-vd2YExXsj0xGBwYhZ4kGUihwYtLtNVhzObgSzg,478
|
82
82
|
unfold/templates/admin/auth/user/change_password.html,sha256=-Wa9ml3yss-kDz0YQxCiwoxs91KQD8eetCt5l6xekWM,2892
|
83
|
-
unfold/templates/admin/base.html,sha256=
|
83
|
+
unfold/templates/admin/base.html,sha256=MGqtCcydXZPnp6dasaWktyd9D6rdUYX01rFGAv7Zkm4,2226
|
84
84
|
unfold/templates/admin/base_site.html,sha256=3ckWrcAdd7Pw1hk6Zwyknab_Qb-rteV9-mXhMnfo6VI,361
|
85
|
-
unfold/templates/admin/change_form.html,sha256
|
85
|
+
unfold/templates/admin/change_form.html,sha256=-X_fQOGaa6k0WVbMO7he9bZIdIY3oj8PyRSV4dnt6qA,5320
|
86
86
|
unfold/templates/admin/change_form_object_tools.html,sha256=eyeH-i2HgEM0Yi-OJA2D1VnKJyC19A_my1IDGxxoP8Y,593
|
87
|
-
unfold/templates/admin/change_list.html,sha256=
|
87
|
+
unfold/templates/admin/change_list.html,sha256=18GDZswc1c0xtw2BcKti9SX95Ar9e1BX_HSY0K79g_8,5102
|
88
88
|
unfold/templates/admin/change_list_object_tools.html,sha256=cmMiT2nT20Ph5yfpj9aHPr76Z-JP4aSXp0o-Rnad28s,147
|
89
|
-
unfold/templates/admin/change_list_results.html,sha256=
|
89
|
+
unfold/templates/admin/change_list_results.html,sha256=32zSgJ6W5uQlfzI-0N1FmCFagw2VYaXuiUZyZbxUIag,5004
|
90
90
|
unfold/templates/admin/date_hierarchy.html,sha256=BfUPbsLpHZVa40BHBahz1H9RSVuz36Jc3yrlobOiIpw,1306
|
91
91
|
unfold/templates/admin/delete_confirmation.html,sha256=hpa2E14oZEXBBs6W1qdNQuF650TIO2Rhr52Q6UfwVeQ,5166
|
92
92
|
unfold/templates/admin/delete_selected_confirmation.html,sha256=Foka2yvwAMEZre-Kh1KNadRzrCotdKM2U4e6AJQYZu8,4941
|
93
93
|
unfold/templates/admin/edit_inline/stacked.html,sha256=U6O_r9-5Hp7mT0l1EgTeBB8tc9nEAAi0etL2aCU2pBM,4415
|
94
|
-
unfold/templates/admin/edit_inline/tabular.html,sha256=
|
94
|
+
unfold/templates/admin/edit_inline/tabular.html,sha256=YOrCgAQ9apLZf8VtFmUhK-WFoQomPtlilT9ktkEFBQA,12315
|
95
95
|
unfold/templates/admin/filter.html,sha256=JAp95Mg6W2Pfdrr-gxEZld9EvgMGLj8etMdSl84l4ro,1686
|
96
96
|
unfold/templates/admin/includes/fieldset.html,sha256=r4XjcZAOkWxHQExHZBWoCGtO3LYL0Iwkw1C55oR5V6M,2898
|
97
97
|
unfold/templates/admin/includes/object_delete_summary.html,sha256=Nv69SCzyJHFX14iJFfodxKM0IIpQegKZH0fvKB15QJI,468
|
98
98
|
unfold/templates/admin/index.html,sha256=pkGdKWdD3zzOvkRdELvdb15sleSpfl4eHPA14PAh7z0,684
|
99
|
-
unfold/templates/admin/login.html,sha256=
|
99
|
+
unfold/templates/admin/login.html,sha256=WdOfFLofwBWj9VKCq1U22uLY19J2YQY6vRaE4OOSKfQ,3681
|
100
100
|
unfold/templates/admin/nav_sidebar.html,sha256=63lUhsHfrjZowplnOEq4BkGD9jlX0bVQw5VrAMJqf5M,1178
|
101
101
|
unfold/templates/admin/object_history.html,sha256=PsbhXFd_3SCB9YkSJeHESp2VqjNlHtUW26mRtaZ-MD0,5069
|
102
102
|
unfold/templates/admin/pagination.html,sha256=KWTPV7_hVSZ1374a-pqHXhnOueNQKu1UnSUYirrWtCk,1173
|
103
|
-
unfold/templates/admin/search_form.html,sha256=
|
103
|
+
unfold/templates/admin/search_form.html,sha256=8fJlPYHQDCm4Je05wwdNJuJQR6ChLgghWmo-yHSybMs,1099
|
104
104
|
unfold/templates/admin/submit_line.html,sha256=Oi7lUe2oh8O4--ZM0eQzVtZQnRKVeVXylc1ECGA7zKI,4247
|
105
|
-
unfold/templates/admin/widgets/clearable_file_input.html,sha256=vXsyP0-YD-z3z6VL4vXW9pJH9_-ZU9u-3AnmZkni-R4,1994
|
106
|
-
unfold/templates/admin/widgets/radio.html,sha256=3WcmclQNg7R_pRjEHL1dHkGjAzWlWNYnhHkAirC4nuA,646
|
107
|
-
unfold/templates/admin/widgets/radio_option.html,sha256=IZgPx-aWKJuxrSalJ3K50RFd1vwSpb9Qk0yZwfV78_A,368
|
108
|
-
unfold/templates/admin/widgets/related_widget_wrapper.html,sha256=U6RaeR86xbi1AWUrMm1SbjlXGwpC3PZdNLTbk3alxXI,3799
|
109
|
-
unfold/templates/admin/widgets/split_datetime.html,sha256=eXLFZyCv84LCTFWAUhNO3xAIzWvGBvI1ZpYbB38_HOI,862
|
110
105
|
unfold/templates/auth/widgets/read_only_password_hash.html,sha256=Li9efo-3cFC5zj9im0SPfc62R4ZNVPQhs24H1U7xmD8,785
|
111
106
|
unfold/templates/registration/logged_out.html,sha256=E7RHtB6AGQwgUIiV7dwJ1DbdfNvEhzJARONnB6jRLhQ,1028
|
112
107
|
unfold/templates/registration/password_change_done.html,sha256=i1ZzfTwZHWNWoN9_xHZDdcgLdTOVbTFFD1HUSuG0LkY,1062
|
@@ -122,15 +117,15 @@ unfold/templates/unfold/components/progress.html,sha256=pfdSjZD17IK4L5kGO8tRYikp
|
|
122
117
|
unfold/templates/unfold/components/separator.html,sha256=G0IlKIFEXJmLZc0KP2YcsLzkaskeb0PrLvOdoKFTgmc,90
|
123
118
|
unfold/templates/unfold/components/text.html,sha256=-GjxvdiaBQIaNfPSzT6SSIwnc3R27FkSDQMoF3FDPso,102
|
124
119
|
unfold/templates/unfold/components/title.html,sha256=PSiNK-s8jUJfu6f9zCcGOOyLiKxS-dsAFu3aR-yjNdU,131
|
125
|
-
unfold/templates/unfold/helpers/account_links.html,sha256=
|
120
|
+
unfold/templates/unfold/helpers/account_links.html,sha256=Kc1FobAVN3B34x9vcMoEXyuQ45d5SjfjaJSo3UErL3Q,1934
|
126
121
|
unfold/templates/unfold/helpers/actions_row.html,sha256=1xd39zx38NOoKuDuxAG7PHeu5x2OTIraQGFkm15Erqg,1681
|
127
122
|
unfold/templates/unfold/helpers/add_link.html,sha256=mIgpKrwqBO1oJ4cwPQWSX1oUHBwHJmy5-2TxUHf-1bo,808
|
128
|
-
unfold/templates/unfold/helpers/app_list.html,sha256=
|
123
|
+
unfold/templates/unfold/helpers/app_list.html,sha256=FvL-cEOVxwckP5TqzLEYL34EMlYiCd6gRy0oguBaRMw,4691
|
129
124
|
unfold/templates/unfold/helpers/app_list_default.html,sha256=vZkw1F7oHOKReNkdHRYjhuNdA1nNdvSD4wbDmf0bnsM,4102
|
130
125
|
unfold/templates/unfold/helpers/boolean.html,sha256=p_WOlytoXvDwta76WgcV4JSWKpBgKf4amhqmHF798F8,564
|
131
126
|
unfold/templates/unfold/helpers/breadcrumb_item.html,sha256=k_1j57UV0WtzFFlMKaewj4NLbR_DhXI6RzCHThblZLw,234
|
132
127
|
unfold/templates/unfold/helpers/display_header.html,sha256=E-yG9ydyb6rRIR5TT4FxekD3qokilfoOwaEaB7np8WI,433
|
133
|
-
unfold/templates/unfold/helpers/display_label.html,sha256=
|
128
|
+
unfold/templates/unfold/helpers/display_label.html,sha256=LS9DWzYjHkYLV27sZDwyXlg2sLJ0AlId9FbjnXpsbfg,317
|
134
129
|
unfold/templates/unfold/helpers/field.html,sha256=oEhGUrLZi2hiuLaC96R2zdwD8DNZqX2_sJIxTpPTJDM,340
|
135
130
|
unfold/templates/unfold/helpers/field_readonly.html,sha256=v7-2oSSDgOsuYpP70y8DqdBqbRybubAfSDzstveoBuw,382
|
136
131
|
unfold/templates/unfold/helpers/fieldsets_tabs.html,sha256=-l8ni5jeJQPNxucAn4ujbts08Bp2WuGlQGnHpBMk5Os,1316
|
@@ -153,27 +148,32 @@ unfold/templates/unfold/helpers/site_icon.html,sha256=RO-R5yRt6yOx41Z8dpDP4lzwMX
|
|
153
148
|
unfold/templates/unfold/helpers/site_logo.html,sha256=05tqXzHy--pluceRQ2jDUZCFX9DjPHdBqGaieUv9sXk,424
|
154
149
|
unfold/templates/unfold/helpers/submit.html,sha256=oSzq85LRLhdOlbFtFZFhYm6ucT95u6LunTeSTDClszQ,206
|
155
150
|
unfold/templates/unfold/helpers/tab_action.html,sha256=wanUlr_CKqSjxvKC7_moHFWK-hd7aT3KDdNATkJE2XE,337
|
156
|
-
unfold/templates/unfold/helpers/tab_list.html,sha256=
|
151
|
+
unfold/templates/unfold/helpers/tab_list.html,sha256=WMFSx0HEvylI_AOIPtFuWff1ePJkY6HS-PhRwo0EBUk,2029
|
157
152
|
unfold/templates/unfold/helpers/theme_switch.html,sha256=skkl6fYUnYLM7fAPivHxWjnOnuQSKa-7aDxh7I8dGIg,2266
|
158
153
|
unfold/templates/unfold/helpers/userlinks.html,sha256=qWjtBt9Q_tU8a874ii0Qqg8t_d-SSYBTB_3QZfNlx9g,634
|
159
154
|
unfold/templates/unfold/helpers/welcomemsg.html,sha256=noRysgSENef4_53pXaTiBCy2or6lQm1ZtmCQVODAB1c,1120
|
160
|
-
unfold/templates/unfold/layouts/base_simple.html,sha256=
|
155
|
+
unfold/templates/unfold/layouts/base_simple.html,sha256=rki7n7QagHFAaCEn488pTOj9dpNL9AwwzKps8Ipiubk,993
|
161
156
|
unfold/templates/unfold/layouts/skeleton.html,sha256=D35u-G6-h5SwTMzIZaEURedsPObSjoB198lLsJwmZWs,3278
|
157
|
+
unfold/templates/unfold/widgets/clearable_file_input.html,sha256=vXsyP0-YD-z3z6VL4vXW9pJH9_-ZU9u-3AnmZkni-R4,1994
|
162
158
|
unfold/templates/unfold/widgets/clearable_file_input_small.html,sha256=rqUnHF4jwL8_RySUuq2aXgj-0P_usgo1HeVT_IcfyFY,2531
|
163
|
-
unfold/templates/unfold/widgets/date.html,sha256=
|
159
|
+
unfold/templates/unfold/widgets/date.html,sha256=WXo2LG1v_gBZBSg-zocj7oujMKI0MWLYCIFfB04HMLQ,122
|
160
|
+
unfold/templates/unfold/widgets/radio.html,sha256=3WcmclQNg7R_pRjEHL1dHkGjAzWlWNYnhHkAirC4nuA,646
|
161
|
+
unfold/templates/unfold/widgets/radio_option.html,sha256=IZgPx-aWKJuxrSalJ3K50RFd1vwSpb9Qk0yZwfV78_A,368
|
164
162
|
unfold/templates/unfold/widgets/range.html,sha256=28FBtSUgUcG82vpk_I27Lbs5oWZOV_oMzVhx4wj3-Ik,262
|
163
|
+
unfold/templates/unfold/widgets/related_widget_wrapper.html,sha256=0I6wSu8z_sJPqmX6uZev4mQGIIM336d6kvHdHj36ny4,3831
|
164
|
+
unfold/templates/unfold/widgets/split_datetime.html,sha256=eXLFZyCv84LCTFWAUhNO3xAIzWvGBvI1ZpYbB38_HOI,862
|
165
165
|
unfold/templates/unfold/widgets/split_datetime_vertical.html,sha256=xinCH4kkQ-yKUqcSI7-m-_UEzOEKWqvLTjUa3i-e8EM,881
|
166
166
|
unfold/templates/unfold/widgets/split_money.html,sha256=AFLUBmzGbY-RXgsfz7gaDxVRhplaIPhXjg_hWYo9xcY,352
|
167
167
|
unfold/templates/unfold/widgets/textarea.html,sha256=4xIGWb20DuwiwumndByrAyh7xF-ReXKLulSpDImX_cs,459
|
168
|
-
unfold/templates/unfold/widgets/time.html,sha256=
|
168
|
+
unfold/templates/unfold/widgets/time.html,sha256=WXo2LG1v_gBZBSg-zocj7oujMKI0MWLYCIFfB04HMLQ,122
|
169
169
|
unfold/templatetags/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
170
170
|
unfold/templatetags/unfold.py,sha256=HFe0GrTD4va0lLzsZhxqjEOONmehqOWdf5vulkxgfGU,6302
|
171
|
-
unfold/templatetags/unfold_list.py,sha256=
|
171
|
+
unfold/templatetags/unfold_list.py,sha256=5xAjQX0_JnVwDaj-wGkGqbjOAtp-a18koWIKj5VfBz0,13867
|
172
172
|
unfold/typing.py,sha256=1P8PWM2oeaceUJtA5j071RbKEBpHYaux441u7Hd6wv4,643
|
173
173
|
unfold/utils.py,sha256=5OIgDcwvIJQbwbnnqHx61cHh-2T1h184mTAuNq5WXLI,4088
|
174
174
|
unfold/views.py,sha256=Ml3XlEoHLcbEWof59Dw8ihKBMcmp-gBAibThtBFj55A,708
|
175
|
-
unfold/widgets.py,sha256=
|
176
|
-
django_unfold-0.
|
177
|
-
django_unfold-0.
|
178
|
-
django_unfold-0.
|
179
|
-
django_unfold-0.
|
175
|
+
unfold/widgets.py,sha256=e2yGwpyO7VT1NoSj0VzzRlmQZIzREAKOgp7CkyZ4hv0,14204
|
176
|
+
django_unfold-0.23.0.dist-info/LICENSE.md,sha256=Ltk_quRyyvV3J5v3brtOqmibeZSw2Hrb8bY1W3ya0Ik,1077
|
177
|
+
django_unfold-0.23.0.dist-info/METADATA,sha256=j8ueC2Ym74SeXEcdOxhx1KT4JfRLK7kO1pjj1rmlqdI,42827
|
178
|
+
django_unfold-0.23.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
179
|
+
django_unfold-0.23.0.dist-info/RECORD,,
|
unfold/admin.py
CHANGED
@@ -8,6 +8,7 @@ from django.contrib.admin import StackedInline as BaseStackedInline
|
|
8
8
|
from django.contrib.admin import TabularInline as BaseTabularInline
|
9
9
|
from django.contrib.admin import display, helpers
|
10
10
|
from django.contrib.admin.utils import lookup_field
|
11
|
+
from django.contrib.admin.widgets import RelatedFieldWidgetWrapper
|
11
12
|
from django.core.exceptions import ObjectDoesNotExist
|
12
13
|
from django.db import models
|
13
14
|
from django.db.models import (
|
@@ -39,7 +40,6 @@ from django.utils.safestring import SafeText, mark_safe
|
|
39
40
|
from django.utils.text import capfirst
|
40
41
|
from django.utils.translation import gettext_lazy as _
|
41
42
|
from django.views import View
|
42
|
-
from unfold.utils import display_for_field
|
43
43
|
|
44
44
|
from .checks import UnfoldModelAdminChecks
|
45
45
|
from .dataclasses import UnfoldAction
|
@@ -47,9 +47,9 @@ from .exceptions import UnfoldException
|
|
47
47
|
from .forms import ActionForm
|
48
48
|
from .settings import get_config
|
49
49
|
from .typing import FieldsetsType
|
50
|
+
from .utils import display_for_field
|
50
51
|
from .widgets import (
|
51
52
|
CHECKBOX_LABEL_CLASSES,
|
52
|
-
INPUT_CLASSES,
|
53
53
|
LABEL_CLASSES,
|
54
54
|
SELECT_CLASSES,
|
55
55
|
UnfoldAdminBigIntegerFieldWidget,
|
@@ -62,6 +62,7 @@ from .widgets import (
|
|
62
62
|
UnfoldAdminMoneyWidget,
|
63
63
|
UnfoldAdminNullBooleanSelectWidget,
|
64
64
|
UnfoldAdminRadioSelectWidget,
|
65
|
+
UnfoldAdminSelect,
|
65
66
|
UnfoldAdminSingleDateWidget,
|
66
67
|
UnfoldAdminSingleTimeWidget,
|
67
68
|
UnfoldAdminSplitDateTimeWidget,
|
@@ -142,6 +143,11 @@ class UnfoldAdminField(helpers.AdminField):
|
|
142
143
|
def label_tag(self) -> SafeText:
|
143
144
|
classes = []
|
144
145
|
|
146
|
+
if not self.field.field.widget.__class__.__name__.startswith(
|
147
|
+
"Unfold"
|
148
|
+
) and not self.field.field.widget.template_name.startswith("unfold"):
|
149
|
+
return super().label_tag()
|
150
|
+
|
145
151
|
# TODO load config from current AdminSite (override Fieldline.__iter__ method)
|
146
152
|
for lang, flag in get_config()["EXTENSIONS"]["modeltranslation"][
|
147
153
|
"flags"
|
@@ -175,6 +181,9 @@ helpers.AdminField = UnfoldAdminField
|
|
175
181
|
|
176
182
|
class UnfoldAdminReadonlyField(helpers.AdminReadonlyField):
|
177
183
|
def label_tag(self) -> SafeText:
|
184
|
+
if not isinstance(self.model_admin, ModelAdmin):
|
185
|
+
return super().label_tag()
|
186
|
+
|
178
187
|
attrs = {
|
179
188
|
"class": " ".join(LABEL_CLASSES + ["mb-2"]),
|
180
189
|
}
|
@@ -285,9 +294,7 @@ class ModelAdminMixin:
|
|
285
294
|
radio_style=self.radio_fields[db_field.name]
|
286
295
|
)
|
287
296
|
else:
|
288
|
-
kwargs["widget"] =
|
289
|
-
attrs={"class": " ".join(SELECT_CLASSES)}
|
290
|
-
)
|
297
|
+
kwargs["widget"] = UnfoldAdminSelect()
|
291
298
|
|
292
299
|
kwargs["choices"] = db_field.get_choices(
|
293
300
|
include_blank=db_field.blank, blank_choice=[("", _("Select value"))]
|
@@ -301,16 +308,12 @@ class ModelAdminMixin:
|
|
301
308
|
# Overrides widgets for all related fields
|
302
309
|
if "widget" not in kwargs:
|
303
310
|
if db_field.name in self.raw_id_fields:
|
304
|
-
kwargs["widget"] =
|
305
|
-
attrs={"class": " ".join(INPUT_CLASSES)}
|
306
|
-
)
|
311
|
+
kwargs["widget"] = UnfoldAdminTextInputWidget()
|
307
312
|
elif (
|
308
313
|
db_field.name not in self.get_autocomplete_fields(request)
|
309
314
|
and db_field.name not in self.radio_fields
|
310
315
|
):
|
311
|
-
kwargs["widget"] =
|
312
|
-
attrs={"class": " ".join(SELECT_CLASSES)}
|
313
|
-
)
|
316
|
+
kwargs["widget"] = UnfoldAdminSelect()
|
314
317
|
kwargs["empty_label"] = _("Select value")
|
315
318
|
|
316
319
|
return super().formfield_for_foreignkey(db_field, request, **kwargs)
|
@@ -323,9 +326,7 @@ class ModelAdminMixin:
|
|
323
326
|
) -> ModelMultipleChoiceField:
|
324
327
|
if "widget" not in kwargs:
|
325
328
|
if db_field.name in self.raw_id_fields:
|
326
|
-
kwargs["widget"] =
|
327
|
-
attrs={"class": " ".join(INPUT_CLASSES)}
|
328
|
-
)
|
329
|
+
kwargs["widget"] = UnfoldAdminTextInputWidget()
|
329
330
|
|
330
331
|
form_field = super().formfield_for_manytomany(db_field, request, **kwargs)
|
331
332
|
|
@@ -342,9 +343,7 @@ class ModelAdminMixin:
|
|
342
343
|
self, db_field: Field, request: HttpRequest, **kwargs
|
343
344
|
) -> Optional[Field]:
|
344
345
|
if "widget" not in kwargs:
|
345
|
-
kwargs["widget"] =
|
346
|
-
attrs={"class": " ".join(SELECT_CLASSES)}
|
347
|
-
)
|
346
|
+
kwargs["widget"] = UnfoldAdminNullBooleanSelectWidget()
|
348
347
|
|
349
348
|
return db_field.formfield(**kwargs)
|
350
349
|
|
@@ -354,7 +353,14 @@ class ModelAdminMixin:
|
|
354
353
|
if isinstance(db_field, models.BooleanField) and db_field.null is True:
|
355
354
|
return self.formfield_for_nullboolean_field(db_field, request, **kwargs)
|
356
355
|
|
357
|
-
|
356
|
+
formfield = super().formfield_for_dbfield(db_field, request, **kwargs)
|
357
|
+
|
358
|
+
if formfield and isinstance(formfield.widget, RelatedFieldWidgetWrapper):
|
359
|
+
formfield.widget.template_name = (
|
360
|
+
"unfold/widgets/related_widget_wrapper.html"
|
361
|
+
)
|
362
|
+
|
363
|
+
return formfield
|
358
364
|
|
359
365
|
|
360
366
|
class ModelAdmin(ModelAdminMixin, BaseModelAdmin):
|
@@ -400,7 +406,7 @@ class ModelAdmin(ModelAdminMixin, BaseModelAdmin):
|
|
400
406
|
filtered_actions.append(action)
|
401
407
|
continue
|
402
408
|
permission_checks = (
|
403
|
-
getattr(self, "has_
|
409
|
+
getattr(self, f"has_{permission}_permission")
|
404
410
|
for permission in action.method.allowed_permissions
|
405
411
|
)
|
406
412
|
if any(has_permission(request) for has_permission in permission_checks):
|
@@ -546,7 +552,8 @@ class ModelAdmin(ModelAdminMixin, BaseModelAdmin):
|
|
546
552
|
"title": action.description,
|
547
553
|
"attrs": action.method.attrs,
|
548
554
|
"path": reverse(
|
549
|
-
f"
|
555
|
+
f"{self.admin_site.name}:{action.action_name}",
|
556
|
+
args=(object_id,),
|
550
557
|
),
|
551
558
|
}
|
552
559
|
)
|
@@ -570,7 +577,7 @@ class ModelAdmin(ModelAdminMixin, BaseModelAdmin):
|
|
570
577
|
{
|
571
578
|
"title": action.description,
|
572
579
|
"attrs": action.method.attrs,
|
573
|
-
"path": reverse(f"
|
580
|
+
"path": reverse(f"{self.admin_site.name}:{action.action_name}"),
|
574
581
|
}
|
575
582
|
for action in self.get_actions_list(request)
|
576
583
|
]
|
@@ -579,7 +586,7 @@ class ModelAdmin(ModelAdminMixin, BaseModelAdmin):
|
|
579
586
|
{
|
580
587
|
"title": action.description,
|
581
588
|
"attrs": action.method.attrs,
|
582
|
-
"raw_path": f"
|
589
|
+
"raw_path": f"{self.admin_site.name}:{action.action_name}",
|
583
590
|
}
|
584
591
|
for action in self.get_actions_row(request)
|
585
592
|
]
|
unfold/apps.py
CHANGED
@@ -7,9 +7,14 @@ from .sites import UnfoldAdminSite
|
|
7
7
|
|
8
8
|
class DefaultAppConfig(AppConfig):
|
9
9
|
name = "unfold"
|
10
|
+
default = True
|
10
11
|
|
11
12
|
def ready(self):
|
12
13
|
site = UnfoldAdminSite()
|
13
14
|
|
14
15
|
admin.site = site
|
15
16
|
sites.site = site
|
17
|
+
|
18
|
+
|
19
|
+
class BasicAppConfig(AppConfig):
|
20
|
+
name = "unfold"
|
unfold/checks.py
CHANGED
@@ -30,7 +30,7 @@ class UnfoldModelAdminChecks(ModelAdminChecks):
|
|
30
30
|
if not hasattr(action.method, "allowed_permissions"):
|
31
31
|
continue
|
32
32
|
for permission in action.method.allowed_permissions:
|
33
|
-
method_name = "has_
|
33
|
+
method_name = f"has_{permission}_permission"
|
34
34
|
if not hasattr(obj, method_name):
|
35
35
|
errors.append(
|
36
36
|
checks.Error(
|
unfold/contrib/filters/apps.py
CHANGED
unfold/contrib/forms/apps.py
CHANGED
unfold/contrib/guardian/apps.py
CHANGED
unfold/forms.py
CHANGED
@@ -22,7 +22,12 @@ from .widgets import BASE_INPUT_CLASSES, INPUT_CLASSES, SELECT_CLASSES
|
|
22
22
|
class ActionForm(forms.Form):
|
23
23
|
action = forms.ChoiceField(
|
24
24
|
label="",
|
25
|
-
widget=forms.Select(
|
25
|
+
widget=forms.Select(
|
26
|
+
{
|
27
|
+
"class": " ".join([*SELECT_CLASSES, "max-w-full", "lg:!w-64"]),
|
28
|
+
"x-model": "action",
|
29
|
+
}
|
30
|
+
),
|
26
31
|
)
|
27
32
|
|
28
33
|
select_across = forms.BooleanField(
|
unfold/sites.py
CHANGED
@@ -205,7 +205,7 @@ class UnfoldAdminSite(AdminSite):
|
|
205
205
|
|
206
206
|
from .forms import AdminOwnPasswordChangeForm
|
207
207
|
|
208
|
-
url = reverse("
|
208
|
+
url = reverse(f"{self.name}:password_change_done", current_app=self.name)
|
209
209
|
defaults = {
|
210
210
|
"form_class": AdminOwnPasswordChangeForm,
|
211
211
|
"success_url": url,
|
@@ -224,9 +224,9 @@ class UnfoldAdminSite(AdminSite):
|
|
224
224
|
if not isinstance(link, str):
|
225
225
|
link = str(link)
|
226
226
|
|
227
|
-
if link in request.path and link != reverse_lazy("
|
227
|
+
if link in request.path and link != reverse_lazy(f"{self.name}:index"):
|
228
228
|
return True
|
229
|
-
elif link == request.path == reverse_lazy("
|
229
|
+
elif link == request.path == reverse_lazy(f"{self.name}:index"):
|
230
230
|
return True
|
231
231
|
|
232
232
|
return False
|
@@ -266,7 +266,7 @@ class UnfoldAdminSite(AdminSite):
|
|
266
266
|
if "badge" in item and isinstance(item["badge"], str):
|
267
267
|
try:
|
268
268
|
callback = import_string(item["badge"])
|
269
|
-
item["
|
269
|
+
item["badge_callback"] = lazy(callback)(request)
|
270
270
|
except ImportError:
|
271
271
|
pass
|
272
272
|
|