From db3103a4332f5111c3709c08d7221488fdcdfa75 Mon Sep 17 00:00:00 2001 From: Leandro Roberto Date: Sat, 13 Mar 2021 16:17:21 -0300 Subject: [PATCH] HOT-FIX: ajuste no crud - inclui leitura customizada da origem do layouts.yaml - corrige classes css em crud/detail.html - ajusta leitura de hook field --- sapl/crispy_layout_mixin.py | 5 +++-- sapl/crud/base.py | 27 +++++++++++++++------------ sapl/templates/crud/detail.html | 6 +++--- 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/sapl/crispy_layout_mixin.py b/sapl/crispy_layout_mixin.py index 8e6a61806..8c9763eef 100644 --- a/sapl/crispy_layout_mixin.py +++ b/sapl/crispy_layout_mixin.py @@ -190,8 +190,9 @@ class CrispyLayoutFormMixin: return getattr(obj.model, obj.model_set).field.model.__name__ - def get_layout(self): - yaml_layout = '%s/layouts.yaml' % self.model._meta.app_config.label + def get_layout(self, yaml_layout=None): + if not yaml_layout: + yaml_layout = '%s/layouts.yaml' % self.model._meta.app_config.label return read_layout_from_yaml(yaml_layout, self.layout_key) def get_layout_set(self): diff --git a/sapl/crud/base.py b/sapl/crud/base.py index 7dc872216..008266f2f 100644 --- a/sapl/crud/base.py +++ b/sapl/crud/base.py @@ -467,18 +467,21 @@ class CrudListView(PermissionRequiredContainerCrudMixin, ListView): break ss = '' - if m: - ss = get_field_display(m, n[-1])[1] - ss = ( - ('
' if '