From 27b0542087257dc41d884560c7e5585e47ee4bcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Rodrigues?= Date: Mon, 16 Dec 2019 19:33:05 -0300 Subject: [PATCH] Fix #3063 --- sapl/protocoloadm/views.py | 5 ++ .../protocoloadm/MateriaTemplate.html | 50 +++++++++++-------- 2 files changed, 34 insertions(+), 21 deletions(-) diff --git a/sapl/protocoloadm/views.py b/sapl/protocoloadm/views.py index 496c3fcaa..26e2ba283 100755 --- a/sapl/protocoloadm/views.py +++ b/sapl/protocoloadm/views.py @@ -934,6 +934,11 @@ class ProtocoloMateriaTemplateView(PermissionRequiredMixin, TemplateView): **kwargs) protocolo = Protocolo.objects.get(pk=self.kwargs['pk']) context.update({'protocolo': protocolo}) + + context['protocolo_materia'] = MateriaLegislativa.objects.filter( + numero_protocolo=protocolo.numero, ano=protocolo.ano + ).exists() + return context diff --git a/sapl/templates/protocoloadm/MateriaTemplate.html b/sapl/templates/protocoloadm/MateriaTemplate.html index 2207628f5..01a9211ad 100644 --- a/sapl/templates/protocoloadm/MateriaTemplate.html +++ b/sapl/templates/protocoloadm/MateriaTemplate.html @@ -2,28 +2,36 @@ {% load i18n common_tags%} {% block base_content %} - - -
- -
-
- Imprimir Etiqueta -
-
- Imprimir Comprovante -
+ - -
- -
- Continuar +
+
+
+ + Imprimir Etiqueta + +
+
+ + Imprimir Comprovante + +
+ +
+ {% if not protocolo_materia %} + Criar Matéria + {% endif %} +
+
+ Continuar +
-
{% endblock base_content %}