diff --git a/sapl/protocoloadm/urls.py b/sapl/protocoloadm/urls.py index 1de09a01a..21c627b06 100644 --- a/sapl/protocoloadm/urls.py +++ b/sapl/protocoloadm/urls.py @@ -10,6 +10,7 @@ from sapl.protocoloadm.views import (AnularProtocoloAdmView, DocumentoAdministrativoCrud, PesquisarDocumentoAdministrativoView, ProtocoloDocumentoView, + ProtocoloMateriaTemplateView, ProtocoloMateriaView, ProtocoloMostrarView, ProtocoloPesquisaView, @@ -60,6 +61,8 @@ urlpatterns_protocolo = [ + url(r'^protocoloadm/(?P\d+)/continuar$', + ProtocoloMateriaTemplateView.as_view(), name='materia_continuar'), url(r'^protocoloadm/anular-protocolo', diff --git a/sapl/protocoloadm/views.py b/sapl/protocoloadm/views.py index 5019d47bf..dd478b93a 100644 --- a/sapl/protocoloadm/views.py +++ b/sapl/protocoloadm/views.py @@ -312,8 +312,9 @@ class ProtocoloMateriaView(PermissionRequiredMixin, CreateView): form_valid_message = _('Matéria cadastrada com sucesso!') permission_required = ('protocoloadm.add_protocolo',) - def get_success_url(self): - return reverse('sapl.protocoloadm:protocolo') + def get_success_url(self, protocolo): + return reverse('sapl.protocoloadm:materia_continuar', kwargs={ + 'pk': protocolo.pk}) def form_valid(self, form): try: @@ -351,7 +352,20 @@ class ProtocoloMateriaView(PermissionRequiredMixin, CreateView): protocolo.numero_paginas = self.request.POST['numero_paginas'] protocolo.observacao = self.request.POST['observacao'] protocolo.save() - return redirect(self.get_success_url()) + return redirect(self.get_success_url(protocolo)) + + +class ProtocoloMateriaTemplateView(PermissionRequiredMixin, TemplateView): + + template_name = "protocoloadm/MateriaTemplate.html" + permission_required = ('protocoloadm.detail_protocolo', ) + + def get_context_data(self, **kwargs): + context = super(ProtocoloMateriaTemplateView, self).get_context_data( + **kwargs) + protocolo = Protocolo.objects.get(pk=self.kwargs['pk']) + context.update({'protocolo': protocolo}) + return context class PesquisarDocumentoAdministrativoView(DocumentoAdministrativoMixin, diff --git a/sapl/templates/protocoloadm/MateriaTemplate.html b/sapl/templates/protocoloadm/MateriaTemplate.html new file mode 100644 index 000000000..0af0ddbf9 --- /dev/null +++ b/sapl/templates/protocoloadm/MateriaTemplate.html @@ -0,0 +1,14 @@ +{% extends "base.html" %} +{% load i18n common_tags%} + +{% block base_content %} +Matéria procololada com sucesso! +
+Imprimir Etiqueta +Comprovante + +
+Criar Matéria +
+Continuar +{% endblock base_content %}