django-smartbase-admin 1.0.6b2__py3-none-any.whl → 1.0.6b3__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/admin/admin_base.py +35 -32
- django_smartbase_admin/admin/widgets.py +1 -1
- django_smartbase_admin/templates/sb_admin/actions/change_form.html +5 -5
- django_smartbase_admin/templates/sb_admin/inlines/table_inline.html +1 -1
- {django_smartbase_admin-1.0.6b2.dist-info → django_smartbase_admin-1.0.6b3.dist-info}/METADATA +1 -1
- {django_smartbase_admin-1.0.6b2.dist-info → django_smartbase_admin-1.0.6b3.dist-info}/RECORD +8 -8
- {django_smartbase_admin-1.0.6b2.dist-info → django_smartbase_admin-1.0.6b3.dist-info}/LICENSE.md +0 -0
- {django_smartbase_admin-1.0.6b2.dist-info → django_smartbase_admin-1.0.6b3.dist-info}/WHEEL +0 -0
|
@@ -195,7 +195,7 @@ class SBAdminFormFieldWidgetsMixin:
|
|
|
195
195
|
)
|
|
196
196
|
|
|
197
197
|
def get_autocomplete_widget(
|
|
198
|
-
|
|
198
|
+
self, request, form_field, db_field, model, multiselect=False
|
|
199
199
|
):
|
|
200
200
|
return request.request_data.configuration.get_autocomplete_widget(
|
|
201
201
|
self, request, form_field, db_field, model, multiselect
|
|
@@ -286,7 +286,7 @@ class SBAdminFormFieldWidgetsMixin:
|
|
|
286
286
|
)
|
|
287
287
|
form_field.widget = form_field_widget_instance
|
|
288
288
|
if form_field.help_text == _(
|
|
289
|
-
|
|
289
|
+
"Hold down “Control”, or “Command” on a Mac, to select more than one."
|
|
290
290
|
):
|
|
291
291
|
form_field.help_text = ""
|
|
292
292
|
return form_field
|
|
@@ -367,25 +367,25 @@ if parler_enabled:
|
|
|
367
367
|
for translations_model in form_model._parler_meta.get_all_models():
|
|
368
368
|
fields = getattr(form_new_meta, "fields", form_meta.fields)
|
|
369
369
|
exclude = (
|
|
370
|
-
|
|
370
|
+
getattr(form_new_meta, "exclude", form_meta.exclude) or ()
|
|
371
371
|
)
|
|
372
372
|
widgets = (
|
|
373
|
-
|
|
373
|
+
getattr(form_new_meta, "widgets", form_meta.widgets) or ()
|
|
374
374
|
)
|
|
375
375
|
labels = (
|
|
376
|
-
|
|
376
|
+
getattr(form_new_meta, "labels", form_meta.labels) or ()
|
|
377
377
|
)
|
|
378
378
|
help_texts = (
|
|
379
|
-
|
|
380
|
-
|
|
379
|
+
getattr(form_new_meta, "help_texts", form_meta.help_texts)
|
|
380
|
+
or ()
|
|
381
381
|
)
|
|
382
382
|
error_messages = (
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
383
|
+
getattr(
|
|
384
|
+
form_new_meta,
|
|
385
|
+
"error_messages",
|
|
386
|
+
form_meta.error_messages,
|
|
387
|
+
)
|
|
388
|
+
or ()
|
|
389
389
|
)
|
|
390
390
|
formfield_callback = attrs.get("formfield_callback", None)
|
|
391
391
|
|
|
@@ -406,10 +406,10 @@ if parler_enabled:
|
|
|
406
406
|
# The next code holds the same logic as fields_for_model()
|
|
407
407
|
# The f.editable check happens in _get_model_form_field()
|
|
408
408
|
elif (
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
409
|
+
f_name not in form_base_fields
|
|
410
|
+
and (fields is None or f_name in fields)
|
|
411
|
+
and f_name not in exclude
|
|
412
|
+
and not f_name in attrs
|
|
413
413
|
):
|
|
414
414
|
# Get declared widget kwargs
|
|
415
415
|
if f_name in widgets:
|
|
@@ -430,7 +430,7 @@ if parler_enabled:
|
|
|
430
430
|
# See if this formfield was previously defined using a TranslatedField placeholder.
|
|
431
431
|
placeholder = _get_mro_attribute(bases, f_name)
|
|
432
432
|
if placeholder and isinstance(
|
|
433
|
-
|
|
433
|
+
placeholder, TranslatedField
|
|
434
434
|
):
|
|
435
435
|
kwargs.update(placeholder.kwargs)
|
|
436
436
|
|
|
@@ -463,7 +463,6 @@ if parler_enabled:
|
|
|
463
463
|
mcs.parler_orig__new__(mcs, name, bases, attrs)
|
|
464
464
|
return super().__new__(mcs, name, bases, attrs)
|
|
465
465
|
|
|
466
|
-
|
|
467
466
|
class SBTranslatableModelForm(
|
|
468
467
|
BaseTranslatableModelForm,
|
|
469
468
|
SBAdminBaseForm,
|
|
@@ -514,7 +513,7 @@ class SBAdminInlineAndAdminCommon(SBAdminFormFieldWidgetsMixin):
|
|
|
514
513
|
def init_view_dynamic(self, request, request_data=None, **kwargs) -> None:
|
|
515
514
|
if SBAdminTranslationsService.is_translated_model(self.model):
|
|
516
515
|
has_default_form = (
|
|
517
|
-
|
|
516
|
+
self.form == TranslatableModelForm or self.form == forms.ModelForm
|
|
518
517
|
)
|
|
519
518
|
if not self.form or has_default_form:
|
|
520
519
|
self.form = SBTranslatableModelForm
|
|
@@ -568,12 +567,12 @@ class SBAdminThirdParty(SBAdminInlineAndAdminCommon, SBAdminBaseView):
|
|
|
568
567
|
|
|
569
568
|
class SBAdminTranslationStatusMixin:
|
|
570
569
|
def sbadmin_translation_status_row_context(
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
570
|
+
self,
|
|
571
|
+
language,
|
|
572
|
+
languages_count,
|
|
573
|
+
main_language_code,
|
|
574
|
+
current_lang_code,
|
|
575
|
+
translations_edit_url,
|
|
577
576
|
) -> dict[str, Any]:
|
|
578
577
|
language_code = language[0]
|
|
579
578
|
language_title = language[1]
|
|
@@ -665,7 +664,9 @@ class SBAdminInlineFormSetMixin:
|
|
|
665
664
|
if view and view.parent_model and view.opts:
|
|
666
665
|
parent_opts = view.parent_model._meta
|
|
667
666
|
opts = view.opts
|
|
668
|
-
modal_prefix =
|
|
667
|
+
modal_prefix = (
|
|
668
|
+
"modal_" if is_modal(SBAdminThreadLocalService.get_request()) else ""
|
|
669
|
+
)
|
|
669
670
|
return f"{modal_prefix}{parent_opts.app_label}_{parent_opts.model_name}_{opts.app_label}-{opts.model_name}"
|
|
670
671
|
|
|
671
672
|
return super().get_default_prefix()
|
|
@@ -723,7 +724,7 @@ class SBAdmin(
|
|
|
723
724
|
return self.get_model_path()
|
|
724
725
|
|
|
725
726
|
def get_sbadmin_fieldsets(
|
|
726
|
-
|
|
727
|
+
self, request, object_id=None
|
|
727
728
|
) -> Iterable[tuple[str | None, dict[str, Any]]]:
|
|
728
729
|
fieldsets = self.sbadmin_fieldsets or self.fieldsets
|
|
729
730
|
if fieldsets:
|
|
@@ -737,7 +738,7 @@ class SBAdmin(
|
|
|
737
738
|
self.get_form(request)()
|
|
738
739
|
|
|
739
740
|
def get_fieldsets(
|
|
740
|
-
|
|
741
|
+
self, request, obj=None
|
|
741
742
|
) -> list[tuple[str | None, dict[str, Any]]]:
|
|
742
743
|
fieldsets = []
|
|
743
744
|
object_id = obj.id if obj else None
|
|
@@ -754,7 +755,7 @@ class SBAdmin(
|
|
|
754
755
|
return fieldsets
|
|
755
756
|
|
|
756
757
|
def get_fieldsets_context(
|
|
757
|
-
|
|
758
|
+
self, request, object_id
|
|
758
759
|
) -> dict[str, dict[str | None, dict[str, Any]]]:
|
|
759
760
|
fielsets_context = {}
|
|
760
761
|
for fieldset in self.get_sbadmin_fieldsets(request, object_id):
|
|
@@ -970,7 +971,9 @@ class SBAdmin(
|
|
|
970
971
|
parent_pk = request.POST.get(SBADMIN_PARENT_INSTANCE_PK_VAR)
|
|
971
972
|
|
|
972
973
|
if parent_model_path and parent_pk:
|
|
973
|
-
app_label, model_name, field, parent_model =
|
|
974
|
+
prefix, app_label, model_name, field, parent_model = (
|
|
975
|
+
parent_model_path.split("_", 5)
|
|
976
|
+
)
|
|
974
977
|
content_type = ContentType.objects.get(
|
|
975
978
|
app_label=app_label, model=parent_model
|
|
976
979
|
)
|
|
@@ -1041,7 +1044,7 @@ class SBAdminInline(
|
|
|
1041
1044
|
|
|
1042
1045
|
def get_context_data(self, request) -> dict[str, Any]:
|
|
1043
1046
|
is_sortable_active: bool = self.sortable_field_name and (
|
|
1044
|
-
|
|
1047
|
+
self.has_add_permission(request) or self.has_change_permission(request)
|
|
1045
1048
|
)
|
|
1046
1049
|
add_url = None
|
|
1047
1050
|
try:
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
|
|
112
112
|
{% block form %}
|
|
113
113
|
<form {% if has_file_field %}enctype="multipart/form-data" {% endif %}action="{{ form_url }}" method="post"
|
|
114
|
-
id="{% if sbadmin_is_modal %}
|
|
114
|
+
id="{% if sbadmin_is_modal %}modal_{% endif %}{{ opts.model_name }}_form" class="detail-view-form flex-grow flex flex-col w-full max-w-1180 mx-auto" novalidate>
|
|
115
115
|
<div class=" {% if sbadmin_is_modal %}max-h-[70vh] overflow-y-auto sbadmin_is_modal realative flex-grow{% endif %}">
|
|
116
116
|
{% csrf_token %}
|
|
117
117
|
{% if errors %}
|
|
@@ -136,8 +136,8 @@
|
|
|
136
136
|
{% for tab, tab_content_object in tabular_context.context.items %}
|
|
137
137
|
<li role="presentation">
|
|
138
138
|
<button class="relative{% for class in tab_content_object.classes %} {{ class }}{% endfor %}" id="tab_{{ tab|slugify }}" data-bs-toggle="tab"
|
|
139
|
-
data-bs-target="#{% if sbadmin_is_modal %}
|
|
140
|
-
aria-controls="{% if sbadmin_is_modal %}
|
|
139
|
+
data-bs-target="#{% if sbadmin_is_modal %}modal_{% endif %}{{ opts.model_name }}_tabcontent_{{ tab|slugify }}" type="button" role="tab"
|
|
140
|
+
aria-controls="{% if sbadmin_is_modal %}modal_{% endif %}{{ opts.model_name }}_tabcontent_{{ tab|slugify }}" aria-selected="true">
|
|
141
141
|
{{ tab }}
|
|
142
142
|
</button>
|
|
143
143
|
</li>
|
|
@@ -145,7 +145,7 @@
|
|
|
145
145
|
</ul>
|
|
146
146
|
{% endif %}
|
|
147
147
|
{% for tab, tab_content_object in tabular_context.context.items %}
|
|
148
|
-
<div class="detail-view-tab tab-pane fade{% for class in tab_content_object.classes %} {{ class }}{% endfor %} pt-20" id="{% if sbadmin_is_modal %}
|
|
148
|
+
<div class="detail-view-tab tab-pane fade{% for class in tab_content_object.classes %} {{ class }}{% endfor %} pt-20" id="{% if sbadmin_is_modal %}modal_{% endif %}{{ opts.model_name }}_tabcontent_{{ tab|slugify }}" role="tabpanel"
|
|
149
149
|
aria-labelledby="tab_{{ tab|slugify }}">
|
|
150
150
|
<div class="flex max-md:flex-wrap w-full lg:gap-24">
|
|
151
151
|
<div class="min-w-0 w-full">
|
|
@@ -206,7 +206,7 @@
|
|
|
206
206
|
{% url opts|admin_urlname:'add' as post_url %}
|
|
207
207
|
{% endif %}
|
|
208
208
|
<button
|
|
209
|
-
form="{% if sbadmin_is_modal %}
|
|
209
|
+
form="{% if sbadmin_is_modal %}modal_{% endif %}{{ opts.model_name }}_form"
|
|
210
210
|
hx-post="{{ post_url }}"
|
|
211
211
|
hx-target="#sb-admin-modal .modal-content"
|
|
212
212
|
hx-swap="innerHTML"
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
class="btn btn-icon ml-auto {{ inline_admin_formset.handler_classes|join:" " }}"
|
|
30
30
|
data-bs-toggle="modal"
|
|
31
31
|
data-bs-target="#sb-admin-modal"
|
|
32
|
-
hx-get="{{ context_data.add_url }}?_popup=1&sbadmin_is_modal=1&sbadmin_reload_on_save=1&sbadmin_parent_instance_field={{ context_data.parent_data.sbadmin_parent_instance_field }}&sbadmin_parent_instance_pk={{ context_data.parent_data.sbadmin_parent_instance_pk }}&sbadmin_parent_instance_label={{ context_data.parent_data.sbadmin_parent_instance_label }}"
|
|
32
|
+
hx-get="{{ context_data.add_url }}?_popup=1&sbadmin_is_modal=1&sbadmin_reload_on_save=1&sbadmin_parent_instance_field=modal_{{ context_data.parent_data.sbadmin_parent_instance_field }}&sbadmin_parent_instance_pk={{ context_data.parent_data.sbadmin_parent_instance_pk }}&sbadmin_parent_instance_label={{ context_data.parent_data.sbadmin_parent_instance_label }}"
|
|
33
33
|
hx-target="#sb-admin-modal .modal-content"
|
|
34
34
|
hx-swap="innerHTML"
|
|
35
35
|
>
|
{django_smartbase_admin-1.0.6b2.dist-info → django_smartbase_admin-1.0.6b3.dist-info}/RECORD
RENAMED
|
@@ -3,9 +3,9 @@ django_smartbase_admin/actions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5
|
|
|
3
3
|
django_smartbase_admin/actions/admin_action_list.py,sha256=j8PoYgtxNpznf17WIgGbLpxfQ1Hg4waOu08vIh5UIbI,19548
|
|
4
4
|
django_smartbase_admin/actions/advanced_filters.py,sha256=Vm8b6TAwNehR8INjolFG7pEYL4ADO7XUiVOWpb0btM0,13481
|
|
5
5
|
django_smartbase_admin/admin/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
-
django_smartbase_admin/admin/admin_base.py,sha256=
|
|
6
|
+
django_smartbase_admin/admin/admin_base.py,sha256=Ck-E7ABXcbYjENLeUTvcHXOY9frtXfn2pOlH4MDtYPM,46156
|
|
7
7
|
django_smartbase_admin/admin/site.py,sha256=VrJBhwgZsLa2GohvjnNL7m4dVR3S4Ou1V1UzfE1qOoQ,6577
|
|
8
|
-
django_smartbase_admin/admin/widgets.py,sha256=
|
|
8
|
+
django_smartbase_admin/admin/widgets.py,sha256=7_ys5HBQpzvGSD3r5fTKFoDMFP9I-UgfuCw1YkBpcoE,24925
|
|
9
9
|
django_smartbase_admin/apps.py,sha256=C1wT1YUEZNKcUJfpD01nIZEFgYEsuav52WFKvEURRDU,545
|
|
10
10
|
django_smartbase_admin/compilemessages.py,sha256=-_FEFQlOvE4L8UzSuUxSxZQjgGlwL9IZtmg59fW_kIQ,342
|
|
11
11
|
django_smartbase_admin/engine/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -539,7 +539,7 @@ django_smartbase_admin/static/sb_admin/src/js/table_modules/views_module.js,sha2
|
|
|
539
539
|
django_smartbase_admin/static/sb_admin/src/js/translations.js,sha256=GEizlr_D5yDj00i7jKENkWfDr6gZcg4RQ1Nek22WP4g,954
|
|
540
540
|
django_smartbase_admin/static/sb_admin/src/js/tree_widget.js,sha256=rL0znvFm85f74HzNwf9YmUpenV7WfEAr79dD9M4BdxA,18225
|
|
541
541
|
django_smartbase_admin/static/sb_admin/src/js/utils.js,sha256=I6jvqqmgQVIL-VrWWAZsYSAThl3sThhaG4nxquyd4ic,4677
|
|
542
|
-
django_smartbase_admin/templates/sb_admin/actions/change_form.html,sha256=
|
|
542
|
+
django_smartbase_admin/templates/sb_admin/actions/change_form.html,sha256=6W_cvo9g6FobRuGS3wUvWbd9YEccidy9ALiiam4sASY,15453
|
|
543
543
|
django_smartbase_admin/templates/sb_admin/actions/change_password.html,sha256=LhciaKCvlywKMJ6gY9JbEaTkOXjNSFO-mAnWIZfk6sA,3200
|
|
544
544
|
django_smartbase_admin/templates/sb_admin/actions/dashboard.html,sha256=idjrEnXT0EP8gNHMu9QIneaLRhOJwB6QW92brrg7z1s,272
|
|
545
545
|
django_smartbase_admin/templates/sb_admin/actions/delete_confirmation.html,sha256=4AeJLqGGPVBYXS9XQSNTnMvsT3I6QttyNLThE8gEZHE,3205
|
|
@@ -613,7 +613,7 @@ django_smartbase_admin/templates/sb_admin/includes/readonly_boolean_field.html,s
|
|
|
613
613
|
django_smartbase_admin/templates/sb_admin/includes/readonly_field.html,sha256=uGysgcSJJRIwG-AW9Vtfysulz4HOKUNH9Wx0f8sZkuE,291
|
|
614
614
|
django_smartbase_admin/templates/sb_admin/includes/table_inline_delete_button.html,sha256=aAkU6-T3tUrgshrZxny5QSqFUxPI59EKynxfKOMShNc,1170
|
|
615
615
|
django_smartbase_admin/templates/sb_admin/inlines/stacked_inline.html,sha256=L9PkC38cdgvB7YGeJhECmOalZQYtYMBdKUxNCUKScZM,7703
|
|
616
|
-
django_smartbase_admin/templates/sb_admin/inlines/table_inline.html,sha256=
|
|
616
|
+
django_smartbase_admin/templates/sb_admin/inlines/table_inline.html,sha256=dZVDsjVHn6um9cl1iKz5wy4Gpl3gpsXsMNQH46SujkU,17356
|
|
617
617
|
django_smartbase_admin/templates/sb_admin/inlines/table_inline_paginated.html,sha256=2I59KWM_7yvchNjlIWHaHklrklnNsJBwaLlp9mZUYfQ,3046
|
|
618
618
|
django_smartbase_admin/templates/sb_admin/integrations/cms/page_list.html,sha256=juoU5UaqPozIgRX5EJyWpm2-mb1hqM2pfBoePZ1Vs-I,18190
|
|
619
619
|
django_smartbase_admin/templates/sb_admin/integrations/cms/translations_status_row.html,sha256=Ppm6oEmNZkZC_XV5QNFbgccsBumB6LVy1e0Vk8dPMCM,308
|
|
@@ -691,7 +691,7 @@ django_smartbase_admin/views/dashboard_view.py,sha256=vtz5emYTQ5WDFeLA8HrcmjSOVd
|
|
|
691
691
|
django_smartbase_admin/views/global_filter_view.py,sha256=eYo1moJGyi7jc2cPDA5ZBiEgA7Hmc-DxbQvbqUpDkg8,1127
|
|
692
692
|
django_smartbase_admin/views/media_view.py,sha256=5BLWXuzynF7nM34t-mf2BQSRN5ojY8HxpLIqt7Jiq9g,292
|
|
693
693
|
django_smartbase_admin/views/translations_view.py,sha256=JlAE9EPrTmbEVXqX7r0NjdbEv0c9BK3YDj_BYCIPPck,20351
|
|
694
|
-
django_smartbase_admin-1.0.
|
|
695
|
-
django_smartbase_admin-1.0.
|
|
696
|
-
django_smartbase_admin-1.0.
|
|
697
|
-
django_smartbase_admin-1.0.
|
|
694
|
+
django_smartbase_admin-1.0.6b3.dist-info/LICENSE.md,sha256=okRGMBOYvyhprt2eTpX_QXqpzC0MODF-U7zX-4fKPjQ,1078
|
|
695
|
+
django_smartbase_admin-1.0.6b3.dist-info/METADATA,sha256=8ahhrpaLLoWa8SJT-WHY8eIH3K65jIQOqvtLWza_kyE,5335
|
|
696
|
+
django_smartbase_admin-1.0.6b3.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
697
|
+
django_smartbase_admin-1.0.6b3.dist-info/RECORD,,
|
{django_smartbase_admin-1.0.6b2.dist-info → django_smartbase_admin-1.0.6b3.dist-info}/LICENSE.md
RENAMED
|
File without changes
|
|
File without changes
|