Browse Source

Permite a adição de uma query param ?iframe para tirar adornos. (#1191)

* Permite a adição de uma query param ?iframe para tirar adornos.

* Muda setting para ?iframe=0 (desativa) e ?iframe=1 (ativa)

Fixes #1189
pull/1194/head
Edward 8 years ago
committed by GitHub
parent
commit
8d173fcae9
  1. 17
      sapl/base/templatetags/common_tags.py
  2. 6
      sapl/templates/base.html

17
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):

6
sapl/templates/base.html

@ -28,6 +28,7 @@
<body>
<div class="page fadein">
{% if not request|has_iframe %}
{% block navigation %}
<nav class="navbar navbar-inverse navbar-static-top">
<div class="container">
@ -78,6 +79,7 @@
</div>
</nav>
{% endblock navigation %}
{% endif %}
{# Header #}
{% block main_header %}
@ -108,7 +110,6 @@
{# Main content #}
{% block content_container %}
<main id="content" class="content page__row">
<div class="container">
{# Feedback messages #}
@ -152,7 +153,7 @@
{% endblock content_container %}
{% if not request|has_iframe %}
{% block footer_container %}
<footer id="footer" class="footer page__row hidden-print">
<div class="container">
@ -209,6 +210,7 @@
</footer>
</div>
{% endblock footer_container %}
{% endif %}
{% block foot_js %}
<!-- Bootstrap core JavaScript ================================================== -->

Loading…
Cancel
Save