From 097ec904c0b2a3bad2763fb9546654eee81cc704 Mon Sep 17 00:00:00 2001 From: Cesar Carvalho Date: Wed, 24 Apr 2019 13:23:15 -0300 Subject: [PATCH] adicionar visualizacao para superusers --- sapl/materia/views.py | 9 +++++ sapl/templates/materia/tramitacao_detail.html | 35 +++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 sapl/templates/materia/tramitacao_detail.html diff --git a/sapl/materia/views.py b/sapl/materia/views.py index 9f7ca66ae..96bc31afc 100644 --- a/sapl/materia/views.py +++ b/sapl/materia/views.py @@ -1325,6 +1325,15 @@ class TramitacaoCrud(MasterDetailCrud): tramitacao.delete() return HttpResponseRedirect(url) + class DetailView(MasterDetailCrud.DetailView): + + template_name = "materia/tramitacao_detail.html" + + def get_context_data(self, **kwargs): + context = super().get_context_data(**kwargs) + context['user'] = self.request.user + return context + def montar_helper_documento_acessorio(self): autor_row = montar_row_autor('autor') diff --git a/sapl/templates/materia/tramitacao_detail.html b/sapl/templates/materia/tramitacao_detail.html new file mode 100644 index 000000000..0337ae692 --- /dev/null +++ b/sapl/templates/materia/tramitacao_detail.html @@ -0,0 +1,35 @@ +{% extends "crud/detail.html" %} +{% load i18n %} + +{% block actions %} {% endblock %} +{% block detail_content %} + {{ block.super }} + {% if tramitacao.user and user.is_superuser %} +
+
+
+

Usuário

+
+ +
+
+
+
+
+

IP

+
+
+
+ {{tramitacao.ip}} +
+
+
+
+
+
+ {% endif %} +{% endblock detail_content %} \ No newline at end of file