|
|
@ -2,7 +2,6 @@ import logging |
|
|
|
|
|
|
|
|
from braces.views import FormMessagesMixin |
|
|
from braces.views import FormMessagesMixin |
|
|
from crispy_forms.bootstrap import FieldWithButtons, StrictButton |
|
|
from crispy_forms.bootstrap import FieldWithButtons, StrictButton |
|
|
from sapl.crispy_layout_mixin import SaplFormHelper |
|
|
|
|
|
from crispy_forms.layout import Field, Layout |
|
|
from crispy_forms.layout import Field, Layout |
|
|
from django import forms |
|
|
from django import forms |
|
|
from django.conf.urls import url |
|
|
from django.conf.urls import url |
|
|
@ -25,6 +24,7 @@ from django.views.generic.base import ContextMixin |
|
|
from django.views.generic.list import MultipleObjectMixin |
|
|
from django.views.generic.list import MultipleObjectMixin |
|
|
|
|
|
|
|
|
from sapl.crispy_layout_mixin import CrispyLayoutFormMixin, get_field_display |
|
|
from sapl.crispy_layout_mixin import CrispyLayoutFormMixin, get_field_display |
|
|
|
|
|
from sapl.crispy_layout_mixin import SaplFormHelper |
|
|
from sapl.rules.map_rules import (RP_ADD, RP_CHANGE, RP_DELETE, RP_DETAIL, |
|
|
from sapl.rules.map_rules import (RP_ADD, RP_CHANGE, RP_DELETE, RP_DETAIL, |
|
|
RP_LIST) |
|
|
RP_LIST) |
|
|
from sapl.settings import BASE_DIR |
|
|
from sapl.settings import BASE_DIR |
|
|
@ -449,18 +449,23 @@ class CrudListView(PermissionRequiredContainerCrudMixin, ListView): |
|
|
if not n: |
|
|
if not n: |
|
|
s += '<br>' |
|
|
s += '<br>' |
|
|
continue |
|
|
continue |
|
|
m = obj |
|
|
|
|
|
n = n.split('__') |
|
|
hook = 'hook_{}'.format(n) |
|
|
for f in n[:-1]: |
|
|
if hasattr(self, hook): |
|
|
m = getattr(m, f) |
|
|
s += str(getattr(self, hook)(obj)) |
|
|
if not m: |
|
|
else: |
|
|
break |
|
|
m = obj |
|
|
if m: |
|
|
n = n.split('__') |
|
|
ss = get_field_display(m, n[-1])[1] |
|
|
for f in n[:-1]: |
|
|
ss = ( |
|
|
m = getattr(m, f) |
|
|
('<br>' if '<ul>' in ss else ' - ') + ss)\ |
|
|
if not m: |
|
|
if ss and j != 0 and s else ss |
|
|
break |
|
|
s += ss |
|
|
if m: |
|
|
|
|
|
ss = get_field_display(m, n[-1])[1] |
|
|
|
|
|
ss = ( |
|
|
|
|
|
('<br>' if '<ul>' in ss else ' - ') + ss)\ |
|
|
|
|
|
if ss and j != 0 and s else ss |
|
|
|
|
|
s += ss |
|
|
r.append((s, url)) |
|
|
r.append((s, url)) |
|
|
return r |
|
|
return r |
|
|
|
|
|
|
|
|
|