From e84c2b1b28a262467ce56411cab8a6fed44ad4aa Mon Sep 17 00:00:00 2001 From: Eduardo Edson Batista Cordeiro Alves Date: Wed, 14 Sep 2016 16:35:26 -0300 Subject: [PATCH] =?UTF-8?q?Listagem=20das=20mat=C3=A9rias=20encontradas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/materia/views.py | 5 ++ sapl/templates/materia/acessorio_lote.html | 85 +++++++--------------- 2 files changed, 33 insertions(+), 57 deletions(-) diff --git a/sapl/materia/views.py b/sapl/materia/views.py index 3ddd1e946..ce9fa45d7 100644 --- a/sapl/materia/views.py +++ b/sapl/materia/views.py @@ -1252,12 +1252,17 @@ def do_envia_email_tramitacao(request, materia): class DocumentoAcessorioEmLoteView(PermissionRequiredMixin, FilterView): filterset_class = AcessorioEmLoteFilterSet template_name = 'materia/acessorio_lote.html' + permission_required = permissoes_materia() def get_context_data(self, **kwargs): context = super(DocumentoAcessorioEmLoteView, self).get_context_data(**kwargs) context['title'] = _('Documentos Acessórios em Lote') + # Verifica se os campos foram preenchidos + if not self.filterset.form.is_valid(): + return context + qr = self.request.GET.copy() context['filter_url'] = ('&' + qr.urlencode()) if len(qr) > 0 else '' return context diff --git a/sapl/templates/materia/acessorio_lote.html b/sapl/templates/materia/acessorio_lote.html index 7c5493455..f91c3017d 100644 --- a/sapl/templates/materia/acessorio_lote.html +++ b/sapl/templates/materia/acessorio_lote.html @@ -8,66 +8,37 @@ {% crispy filter.form %} {% endif %} - + {% endif %} {% endblock detail_content %}