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 %}