diff --git a/sapl/base/templatetags/common_tags.py b/sapl/base/templatetags/common_tags.py index 718fb2b81..a5c36b66d 100644 --- a/sapl/base/templatetags/common_tags.py +++ b/sapl/base/templatetags/common_tags.py @@ -266,7 +266,20 @@ def has_iframe(obj): session = getattr(obj, "session", None) if not session: return False - return bool(session.get("iframe", False)) + + iframe = session.get('iframe', False) + if not iframe and hasattr(obj, 'GET') and 'iframe' in obj.GET: + ival = obj.GET['iframe'] + if ival and int(ival) == 1: + session['iframe'] = True + return True + elif hasattr(obj, 'GET') and 'iframe' in obj.GET: + ival = obj.GET['iframe'] + if ival and int(ival) == 0: + del session['iframe'] + return False + + return iframe @register.filter diff --git a/sapl/base/templatetags/menus.py b/sapl/base/templatetags/menus.py index 8763d484a..93a2f6c28 100644 --- a/sapl/base/templatetags/menus.py +++ b/sapl/base/templatetags/menus.py @@ -64,6 +64,8 @@ def nav_run(context, path=None): """ rm = request.resolver_match + if rm is None: + return {} app_template = rm.app_name.rsplit('.', 1)[-1] if path: diff --git a/sapl/templates/404.html b/sapl/templates/404.html index b174f7a4f..68ca03c03 100644 --- a/sapl/templates/404.html +++ b/sapl/templates/404.html @@ -1,12 +1,149 @@ {% extends "base.html" %} {% load i18n %} -{% block head_title %}{% trans 'Página não encontrada! Erro 404' %}{% endblock %} +{% block head_title %}{% trans 'Página não encontrada' %} - 404{% endblock %} {% block base_content %} -
{% trans 'A página que você está procurando não foi encontrada.' %}
- {% trans 'Voltar para a página inicial' %} + + +