diff --git a/sapl/base/templatetags/common_tags.py b/sapl/base/templatetags/common_tags.py index 4d66190f2..30db1a92f 100644 --- a/sapl/base/templatetags/common_tags.py +++ b/sapl/base/templatetags/common_tags.py @@ -118,3 +118,11 @@ def ultima_filiacao(value): return ultima_filiacao.partido else: return None + + +@register.filter +def get_config_not_exists(user): + if not AppConfig.objects.all().exists(): + return True + else: + return False diff --git a/sapl/templates/base/appconfig_list.html b/sapl/templates/base/appconfig_list.html new file mode 100644 index 000000000..7bfdfb225 --- /dev/null +++ b/sapl/templates/base/appconfig_list.html @@ -0,0 +1,49 @@ +{% extends "crud/list.html" %} +{% load i18n %} +{% load common_tags %} + +
+ {% if user|get_config_not_exists %} + + {% blocktrans with verbose_name=view.verbose_name %} Adicionar {{ verbose_name }} {% endblocktrans %} + + {% endif %} + {% block more_buttons %}{% endblock more_buttons %} +
+ +

+{% block extra_content %} {% endblock %} + +{% if not rows %} +

{{ NO_ENTRIES_MSG }}

+{% else %} + + + + {% for name in headers %} + + {% endfor %} + + + + {% for value_list in rows %} + + {% for value, href in value_list %} + + {% endfor %} + + {% endfor %} + +
{{ name }}
+ {% if href %} + {{ value }} + {% else %} + {{ value|safe }} + {% endif %} +
+{% endif %} + +{% include "paginacao.html" %} + +{% endblock %} +