diff --git a/sapl/base/templatetags/common_tags.py b/sapl/base/templatetags/common_tags.py index 419899632..eb53629a0 100644 --- a/sapl/base/templatetags/common_tags.py +++ b/sapl/base/templatetags/common_tags.py @@ -117,6 +117,23 @@ def str2intabs(value): except: return '' +@register.filter +def has_iframe(request): + + iframe = request.session.get('iframe', False) + if not iframe and 'iframe' in request.GET: + ival = request.GET['iframe'] + if ival and int(ival) == 1: + request.session['iframe'] = True + return True + elif 'iframe' in request.GET: + ival = request.GET['iframe'] + if ival and int(ival) == 0: + del request.session['iframe'] + return False + + return iframe + @register.filter def url(value): diff --git a/sapl/templates/base.html b/sapl/templates/base.html index 88b877016..9feb3d90f 100644 --- a/sapl/templates/base.html +++ b/sapl/templates/base.html @@ -28,6 +28,7 @@