From 0ed631d820f308685a7cf12637a7ecacd0ed49df 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_pesquisa_materia.html | 37 -------------------- templates/protocoloadm/protocolo_filter.html | 8 ++--- 4 files changed, 13 insertions(+), 52 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 35f00186d..482034c2a 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_pesquisa_materia.html b/templates/paginacao_pesquisa_materia.html deleted file mode 100644 index f82dcd48a..000000000 --- a/templates/paginacao_pesquisa_materia.html +++ /dev/null @@ -1,37 +0,0 @@ -{% if is_paginated %} - -{% endif %} \ No newline at end of file diff --git a/templates/protocoloadm/protocolo_filter.html b/templates/protocoloadm/protocolo_filter.html index ed9219c67..476106a9b 100644 --- a/templates/protocoloadm/protocolo_filter.html +++ b/templates/protocoloadm/protocolo_filter.html @@ -28,11 +28,11 @@ {% for p in page_obj %} - Protocolo: + Protocolo: {{ p.numero|stringformat:'06d' }}/{{ p.ano }} - -   -   + +   -   Etiqueta Individual @@ -65,6 +65,6 @@ -{% include "paginacao_pesquisa_materia.html" %} +{% include "paginacao.html" %} {% endblock detail_content %} \ No newline at end of file