From 47ed37e3e0d360cf75052ce64d940d437959d15f Mon Sep 17 00:00:00 2001 From: Eduardo Calil Date: Wed, 20 Apr 2016 12:33:50 -0300 Subject: [PATCH] Finaliza os detalhes adicionais da tela e resolve alguns bugs --- protocoloadm/forms.py | 18 +++++----- protocoloadm/views.py | 2 +- templates/paginacao.html | 6 ++-- templates/paginacao_pesquisa_materia.html | 37 -------------------- templates/protocoloadm/protocolo_filter.html | 8 ++--- 5 files changed, 16 insertions(+), 55 deletions(-) delete mode 100644 templates/paginacao_pesquisa_materia.html diff --git a/protocoloadm/forms.py b/protocoloadm/forms.py index 52bb4dc6c..dc65e9589 100644 --- a/protocoloadm/forms.py +++ b/protocoloadm/forms.py @@ -104,22 +104,20 @@ class ProtocoloFilterSet(django_filters.FilterSet): self.filters['assunto_ementa'].label = 'Assunto' row1 = crispy_layout_mixin.to_row( - [('numero', 6), - ('ano', 6)]) + [('numero', 4), + ('ano', 4), + ('data', 4)]) row2 = crispy_layout_mixin.to_row( - [('data', 12)]) - - row3 = crispy_layout_mixin.to_row( [('tipo_documento', 4), ('tipo_protocolo', 4), ('tipo_materia', 4)]) - row4 = crispy_layout_mixin.to_row( + row3 = crispy_layout_mixin.to_row( [('interessado', 6), ('assunto_ementa', 6)]) - row5 = crispy_layout_mixin.to_row( + row4 = crispy_layout_mixin.to_row( [('autor', 0), (Button('pesquisar', 'Pesquisar Autor', @@ -127,7 +125,7 @@ class ProtocoloFilterSet(django_filters.FilterSet): (Button('limpar', 'Limpar Autor', css_class='btn btn-primary btn-sm'), 10)]) - row6 = crispy_layout_mixin.to_row( + row5 = crispy_layout_mixin.to_row( [('o', 12)]) self.form.helper = FormHelper() @@ -135,10 +133,10 @@ class ProtocoloFilterSet(django_filters.FilterSet): self.form.helper.layout = Layout( Fieldset(_('Pesquisar Protocolo'), row1, row2, - row3, row4, + row3, HTML(sapl.utils.autor_label), HTML(sapl.utils.autor_modal), - row5, row6, + row4, row5, form_actions(save_label='Pesquisar')) ) diff --git a/protocoloadm/views.py b/protocoloadm/views.py index fe10a7628..7bdf59fe2 100644 --- a/protocoloadm/views.py +++ b/protocoloadm/views.py @@ -80,7 +80,7 @@ class ProtocoloPesquisaView(FilterView): data = self.filterset.data if (data and data.get('numero') is not None): url = "&"+str(self.request.environ['QUERY_STRING']) - if url[:5] == "&page": + if url.startswith("&page"): ponto_comeco = url.find('numero=') - 1 url = url[ponto_comeco:] else: diff --git a/templates/paginacao.html b/templates/paginacao.html index 1092432ac..7bb7db04b 100644 --- a/templates/paginacao.html +++ b/templates/paginacao.html @@ -3,7 +3,7 @@