From 3b716d6b35db80b5a61f4da89ce59ed71e50b5e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Poulain?= Date: Wed, 15 May 2024 15:37:50 +0200 Subject: [PATCH] =?UTF-8?q?feat(template):=20meilleur=20pr=C3=A9sentation?= =?UTF-8?q?=20des=20r=C3=A9servations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fournée/core/admin.py | 3 +- .../admin/inlines/réservations_tabular.html | 138 ++++++++++++++++++ 2 files changed, 140 insertions(+), 1 deletion(-) create mode 100644 fournée/templates/nesting/admin/inlines/réservations_tabular.html diff --git a/fournée/core/admin.py b/fournée/core/admin.py index 3d5ec3a..e36805c 100644 --- a/fournée/core/admin.py +++ b/fournée/core/admin.py @@ -138,13 +138,14 @@ class RéservationInline(nested_admin.NestedTabularInline): classes = ["collapse"] -class CommandeInline(nested_admin.NestedStackedInline): +class CommandeInline(nested_admin.NestedTabularInline): model = models.Commande inlines = [ RéservationInline, ] extra = 1 classes = ["collapse"] + template = "nesting/admin/inlines/réservations_tabular.html" class CouléeInline( diff --git a/fournée/templates/nesting/admin/inlines/réservations_tabular.html b/fournée/templates/nesting/admin/inlines/réservations_tabular.html new file mode 100644 index 0000000..c453a92 --- /dev/null +++ b/fournée/templates/nesting/admin/inlines/réservations_tabular.html @@ -0,0 +1,138 @@ +{% load admin_urlname admin_urlquote from admin_urls %} +{% load i18n nested_admin static %} + +{% with inline_admin_formset.formset.is_nested as is_nested %} + +{% with inline_admin_formset.opts as inline_opts %} +
+ + +
+{% endwith %}{# ends with inline_admin_formset.opts as inline_opts #} + +{% endwith %}{# ends {% with inline_admin_formset.formset.is_nested as is_nested %} #}