diff --git a/sapl/materia/views.py b/sapl/materia/views.py index 075b1b270..241027f3a 100644 --- a/sapl/materia/views.py +++ b/sapl/materia/views.py @@ -1682,6 +1682,13 @@ class MateriaLegislativaCrud(Crud): class DetailView(Crud.DetailView): layout_key = 'MateriaLegislativaDetail' + template_name = "materia/materia_detail.html" + + def get_context_data(self, **kwargs): + context = super().get_context_data(**kwargs) + context['user'] = self.request.user + context['materia'] = MateriaLegislativa.objects.get(pk=self.kwargs['pk']) + return context class ListView(Crud.ListView, RedirectView): diff --git a/sapl/templates/materia/layouts.yaml b/sapl/templates/materia/layouts.yaml index 5db0f0223..44090e522 100644 --- a/sapl/templates/materia/layouts.yaml +++ b/sapl/templates/materia/layouts.yaml @@ -156,4 +156,3 @@ MateriaLegislativaDetail: - ementa - indexacao - observacao - - user ip diff --git a/sapl/templates/materia/materia_detail.html b/sapl/templates/materia/materia_detail.html new file mode 100644 index 000000000..ee1e97c9e --- /dev/null +++ b/sapl/templates/materia/materia_detail.html @@ -0,0 +1,36 @@ +{% extends "crud/detail.html" %} +{% load i18n %} + +{% block detail_content %} + {{ block.super }} + {% if user.is_superuser %} +
Usuário
+IP
+