From bf8a696eab99d0c76177880d3fe99c3eec69bc25 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Mon, 12 Jun 2017 18:41:11 -0300 Subject: [PATCH] =?UTF-8?q?Permite=20a=20adi=C3=A7=C3=A3o=20de=20uma=20que?= =?UTF-8?q?ry=20param=20=3Fiframe=20para=20tirar=20adornos.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/base/templatetags/common_tags.py | 11 +++++++++++ sapl/templates/base.html | 6 ++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/sapl/base/templatetags/common_tags.py b/sapl/base/templatetags/common_tags.py index 419899632..b7312e28c 100644 --- a/sapl/base/templatetags/common_tags.py +++ b/sapl/base/templatetags/common_tags.py @@ -117,6 +117,17 @@ 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: + request.session['iframe'] = True + return True + if 'no-iframe' in request.GET and iframe: + 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 647fcdc15..f9d961c0b 100644 --- a/sapl/templates/base.html +++ b/sapl/templates/base.html @@ -28,6 +28,7 @@
+ {% if not request|has_iframe %} {% block navigation %} {% endblock navigation %} + {% endif %} {# Header #} {% block main_header %} @@ -103,7 +105,6 @@ {# Main content #} {% block content_container %}
-
{# Feedback messages #} @@ -147,7 +148,7 @@ {% endblock content_container %} - + {% if not request|has_iframe %} {% block footer_container %}
@@ -204,6 +205,7 @@
{% endblock footer_container %} + {% endif %} {% block foot_js %}