django-unfold 0.20.0__py3-none-any.whl → 0.20.2__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: django-unfold
3
- Version: 0.20.0
3
+ Version: 0.20.2
4
4
  Summary: Modern Django admin theme for seamless interface development
5
5
  Home-page: https://unfoldadmin.com
6
6
  License: MIT
@@ -19,7 +19,6 @@ Classifier: Programming Language :: Python :: 3.10
19
19
  Classifier: Programming Language :: Python :: 3.11
20
20
  Classifier: Programming Language :: Python :: 3.12
21
21
  Requires-Dist: django (>=3.2)
22
- Requires-Dist: python-semantic-release (>=8.5.0,<9.0.0)
23
22
  Project-URL: Repository, https://github.com/unfoldadmin/django-unfold
24
23
  Description-Content-Type: text/markdown
25
24
 
@@ -59,7 +59,7 @@ unfold/decorators.py,sha256=BVDlxhZxB4ND3f5-5oiENRTv_W_Q_Eu-gZlsrYKOxiU,3272
59
59
  unfold/exceptions.py,sha256=gcCj1ox61E137bk_0Cqy4YC3SttdPgB-fiJUqpmyHSE,43
60
60
  unfold/forms.py,sha256=pLdtUttPmPxanLXKRqAgTLxLSifKJy43JfGcEyL4m2Y,3303
61
61
  unfold/settings.py,sha256=--TdTSWdOA8TQGW4-vjJkjy_zEyd_kZwBr3BIuQ8hzI,1208
62
- unfold/sites.py,sha256=Rk__3wULmSl46k70U4HH9qAlOt10rE4Rtr5BX_6n2SE,12504
62
+ unfold/sites.py,sha256=vuuDLynFSs-6AUSLQCWkD-x-RWYb8XYbKgVcrtzrxB8,12486
63
63
  unfold/static/unfold/css/styles.css,sha256=NPIj8UX1m3m-2dhu0E5MrWbT6NhaVhkdVwr9Sjd8rr8,90338
64
64
  unfold/static/unfold/fonts/inter/Inter-Bold.woff2,sha256=O88EyjAeRPE_QEyKBKpK5wf2epUOEu8wwjj5bnhCZqE,46552
65
65
  unfold/static/unfold/fonts/inter/Inter-Medium.woff2,sha256=O88EyjAeRPE_QEyKBKpK5wf2epUOEu8wwjj5bnhCZqE,46552
@@ -124,7 +124,7 @@ unfold/templates/unfold/components/title.html,sha256=PSiNK-s8jUJfu6f9zCcGOOyLiKx
124
124
  unfold/templates/unfold/helpers/account_links.html,sha256=hyRaNDPKWf3mR4WsMibIi_-SDx5jNztoayzQGJav1oE,1909
125
125
  unfold/templates/unfold/helpers/actions_row.html,sha256=2So5Pei3p1NyTgIDbpRRn9YONNKrSGAmYJzRVdQi23g,1672
126
126
  unfold/templates/unfold/helpers/add_link.html,sha256=mIgpKrwqBO1oJ4cwPQWSX1oUHBwHJmy5-2TxUHf-1bo,808
127
- unfold/templates/unfold/helpers/app_list.html,sha256=CgqqoGkRNyl73ZsNAN_E5-n-JnfujHj7ISjgchko18k,4342
127
+ unfold/templates/unfold/helpers/app_list.html,sha256=8KbYUASYH7XUj2R1eW2MsGRSMNsztIOTOC-c9lCWTEY,4471
128
128
  unfold/templates/unfold/helpers/app_list_default.html,sha256=dmg01K-xrlZaA8z0X4ZJNefpiU0VwarJ7Pm9YplUGAk,3280
129
129
  unfold/templates/unfold/helpers/boolean.html,sha256=p_WOlytoXvDwta76WgcV4JSWKpBgKf4amhqmHF798F8,564
130
130
  unfold/templates/unfold/helpers/breadcrumb_item.html,sha256=k_1j57UV0WtzFFlMKaewj4NLbR_DhXI6RzCHThblZLw,234
@@ -152,7 +152,7 @@ unfold/templates/unfold/helpers/site_icon.html,sha256=RO-R5yRt6yOx41Z8dpDP4lzwMX
152
152
  unfold/templates/unfold/helpers/site_logo.html,sha256=05tqXzHy--pluceRQ2jDUZCFX9DjPHdBqGaieUv9sXk,424
153
153
  unfold/templates/unfold/helpers/submit.html,sha256=oSzq85LRLhdOlbFtFZFhYm6ucT95u6LunTeSTDClszQ,206
154
154
  unfold/templates/unfold/helpers/tab_action.html,sha256=wanUlr_CKqSjxvKC7_moHFWK-hd7aT3KDdNATkJE2XE,337
155
- unfold/templates/unfold/helpers/tab_list.html,sha256=JU7F039RGqNeZWQUp4QZyXx65fGD4iYhtej6yce9eAY,1920
155
+ unfold/templates/unfold/helpers/tab_list.html,sha256=Y7BtJqyVAgMaulSBfy55-surgp7TniLwW3H8eXh54Z8,2029
156
156
  unfold/templates/unfold/helpers/theme_switch.html,sha256=skkl6fYUnYLM7fAPivHxWjnOnuQSKa-7aDxh7I8dGIg,2266
157
157
  unfold/templates/unfold/helpers/userlinks.html,sha256=1t-lALXVUT3GvOUJSVbQjQL-QgQsCyVxFzBwjnGpdf4,575
158
158
  unfold/templates/unfold/helpers/welcomemsg.html,sha256=noRysgSENef4_53pXaTiBCy2or6lQm1ZtmCQVODAB1c,1120
@@ -172,7 +172,7 @@ unfold/typing.py,sha256=1P8PWM2oeaceUJtA5j071RbKEBpHYaux441u7Hd6wv4,643
172
172
  unfold/utils.py,sha256=5OIgDcwvIJQbwbnnqHx61cHh-2T1h184mTAuNq5WXLI,4088
173
173
  unfold/views.py,sha256=Ml3XlEoHLcbEWof59Dw8ihKBMcmp-gBAibThtBFj55A,708
174
174
  unfold/widgets.py,sha256=FThowQCfPVmsFT260j0ufGwPBNxF6JCIEp6QvJ-L0yI,13720
175
- django_unfold-0.20.0.dist-info/LICENSE.md,sha256=D2dAcLArwGySIf62-9y-8Q4pcJOiWj8lLpBxYPzDCBc,1069
176
- django_unfold-0.20.0.dist-info/METADATA,sha256=gUaQpxOqFHLph7lvvz7TYMCA9Yats2z67FZ7W02Flvs,40112
177
- django_unfold-0.20.0.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
178
- django_unfold-0.20.0.dist-info/RECORD,,
175
+ django_unfold-0.20.2.dist-info/LICENSE.md,sha256=D2dAcLArwGySIf62-9y-8Q4pcJOiWj8lLpBxYPzDCBc,1069
176
+ django_unfold-0.20.2.dist-info/METADATA,sha256=Uj8a3D-TEI-tAa9DQiG43cHo8l4NwaajLclpIJS-ArA,40056
177
+ django_unfold-0.20.2.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
178
+ django_unfold-0.20.2.dist-info/RECORD,,
unfold/sites.py CHANGED
@@ -234,10 +234,6 @@ class UnfoldAdminSite(AdminSite):
234
234
  allowed_items = []
235
235
 
236
236
  for item in group["items"]:
237
- # Skip item if permission check fails
238
- if not self._call_permission_callback(item.get("permission"), request):
239
- continue
240
-
241
237
  item["active"] = False
242
238
  item["active"] = _get_is_active(item["link"])
243
239
 
@@ -260,6 +256,11 @@ class UnfoldAdminSite(AdminSite):
260
256
  if isinstance(item["link"], Callable):
261
257
  item["link"] = item["link"](request)
262
258
 
259
+ # Permission callback
260
+ item["has_permission"] = self._call_permission_callback(
261
+ item.get("permission"), request
262
+ )
263
+
263
264
  # Badge callbacks
264
265
  if "badge" in item and isinstance(item["badge"], str):
265
266
  try:
@@ -283,9 +284,9 @@ class UnfoldAdminSite(AdminSite):
283
284
  allowed_items = []
284
285
 
285
286
  for item in tab["items"]:
286
- # Skip item if permission check fails
287
- if not self._call_permission_callback(item.get("permission"), request):
288
- continue
287
+ item["has_permission"] = self._call_permission_callback(
288
+ item.get("permission"), request
289
+ )
289
290
 
290
291
  if isinstance(item["link"], Callable):
291
292
  item["link"] = item["link"](request)
@@ -16,26 +16,27 @@
16
16
 
17
17
  <ol class="px-6">
18
18
  {% for item in group.items %}
19
- <li>
20
- <a href="{{ item.link }}"
21
- class="border border-transparent flex h-11 items-center -mx-3 px-3 py-2 rounded-md {% if item.active %}bg-gray-100 font-semibold text-primary-600 dark:border dark:border-gray-800 dark:bg-white/[.02] dark:text-primary-500{% else %}text-gray-500 hover:text-gray-700 dark:text-gray-400 hover:dark:text-gray-200{% endif %}">
22
- {% if item.icon %}
23
- <span class="material-symbols-outlined md-18 mr-3 w-4.5">
24
- {{ item.icon }}
25
- </span>
26
- {% endif %}
27
-
28
- <span class="text-sm">
29
- {{ item.title|safe }}
30
- </span>
19
+ {% if item.has_permission %}
20
+ <li>
21
+ <a href="{{ item.link }}" class="border border-transparent flex h-11 items-center -mx-3 px-3 py-2 rounded-md {% if item.active %}bg-gray-100 font-semibold text-primary-600 dark:border dark:border-gray-800 dark:bg-white/[.02] dark:text-primary-500{% else %}text-gray-500 hover:text-gray-700 dark:text-gray-400 hover:dark:text-gray-200{% endif %}">
22
+ {% if item.icon %}
23
+ <span class="material-symbols-outlined md-18 mr-3 w-4.5">
24
+ {{ item.icon }}
25
+ </span>
26
+ {% endif %}
31
27
 
32
- {% if item.badge %}
33
- <span class="bg-red-600 font-semibold ml-2 px-1 rounded-sm text-xs text-white">
34
- {{ item.badge|safe }}
28
+ <span class="text-sm">
29
+ {{ item.title|safe }}
35
30
  </span>
36
- {% endif %}
37
- </a>
38
- </li>
31
+
32
+ {% if item.badge %}
33
+ <span class="bg-red-600 font-semibold ml-2 px-1 rounded-sm text-xs text-white">
34
+ {{ item.badge|safe }}
35
+ </span>
36
+ {% endif %}
37
+ </a>
38
+ </li>
39
+ {% endif %}
39
40
  {% endfor %}
40
41
  </ol>
41
42
  {% endif %}
@@ -4,11 +4,13 @@
4
4
  {% if tab_list %}
5
5
  <ul class="border rounded-md flex flex-col w-full md:flex-row md:border-b-0 md:border-t-0 md:border-l-0 md:border-r-0 dark:border-gray-800">
6
6
  {% for item in tab_list %}
7
- <li class="border-b last:border-b-0 md:border-b-0 md:mr-8 dark:border-gray-800">
8
- <a href="{{ item.link }}" class="block px-3 py-2 {% if item.link|stringformat:"s" in request.path %} border-b md:border-primary-500 dark:md:border-primary-600 font-medium -mb-px text-primary-600 hover:text-primary-600 dark:text-primary-500{% else %} hover:text-gray-700 dark:hover:text-gray-200{% endif %} md:py-4 md:px-0 dark:border-gray-800">
9
- {{ item.title }}
10
- </a>
11
- </li>
7
+ {% if item.has_permission %}
8
+ <li class="border-b last:border-b-0 md:border-b-0 md:mr-8 dark:border-gray-800">
9
+ <a href="{{ item.link }}" class="block px-3 py-2 {% if item.link|stringformat:"s" in request.path %} border-b md:border-primary-500 dark:md:border-primary-600 font-medium -mb-px text-primary-600 hover:text-primary-600 dark:text-primary-500{% else %} hover:text-gray-700 dark:hover:text-gray-200{% endif %} md:py-4 md:px-0 dark:border-gray-800">
10
+ {{ item.title }}
11
+ </a>
12
+ </li>
13
+ {% endif %}
12
14
  {% endfor %}
13
15
  </ul>
14
16
  {% endif %}