Browse Source

Fix #1474

pull/1478/head
Eduardo Calil 8 years ago
parent
commit
6ee9668fe9
  1. 45
      sapl/base/views.py
  2. 31
      sapl/materia/views.py
  3. 7
      sapl/norma/views.py
  4. 16
      sapl/protocoloadm/views.py
  5. 8
      sapl/sessao/views.py
  6. 4
      sapl/templates/base/RelatorioHistoricoTramitacao_filter.html
  7. 4
      sapl/templates/base/RelatorioMateriasPorAnoAutorTipo_filter.html
  8. 4
      sapl/templates/base/RelatorioMateriasPorAutor_filter.html
  9. 4
      sapl/templates/base/RelatorioPresencaSessao_filter.html
  10. 4
      sapl/templates/materia/em_lote/acessorio.html
  11. 4
      sapl/templates/materia/em_lote/tramitacao.html
  12. 6
      sapl/templates/materia/materialegislativa_filter.html
  13. 6
      sapl/templates/norma/normajuridica_filter.html
  14. 6
      sapl/templates/protocoloadm/documentoadministrativo_filter.html
  15. 8
      sapl/templates/protocoloadm/protocolo_filter.html
  16. 2
      sapl/templates/sessao/sessaoplenaria_filter.html

45
sapl/base/views.py

@ -202,6 +202,14 @@ class RelatorioAtasView(FilterView):
context['object_list'] = context['object_list'].exclude(upload_ata='') context['object_list'] = context['object_list'].exclude(upload_ata='')
qr = self.request.GET.copy() qr = self.request.GET.copy()
context['filter_url'] = ('&' + qr.urlencode()) if len(qr) > 0 else '' context['filter_url'] = ('&' + qr.urlencode()) if len(qr) > 0 else ''
query_params = set(qr.keys())
if ((len(query_params) == 1 and 'iframe' in query_params) or
len(query_params) == 0):
context['show_results'] = False
else:
context['show_results'] = True
return context return context
@ -294,6 +302,14 @@ class RelatorioPresencaSessaoView(FilterView):
# ===================================================================== # =====================================================================
qr = self.request.GET.copy() qr = self.request.GET.copy()
context['filter_url'] = ('&' + qr.urlencode()) if len(qr) > 0 else '' context['filter_url'] = ('&' + qr.urlencode()) if len(qr) > 0 else ''
query_params = set(qr.keys())
if ((len(query_params) == 1 and 'iframe' in query_params) or
len(query_params) == 0):
context['show_results'] = False
else:
context['show_results'] = True
return context return context
@ -308,6 +324,14 @@ class RelatorioHistoricoTramitacaoView(FilterView):
context['title'] = _('Histórico de Tramitações') context['title'] = _('Histórico de Tramitações')
qr = self.request.GET.copy() qr = self.request.GET.copy()
context['filter_url'] = ('&' + qr.urlencode()) if len(qr) > 0 else '' context['filter_url'] = ('&' + qr.urlencode()) if len(qr) > 0 else ''
query_params = set(qr.keys())
if ((len(query_params) == 1 and 'iframe' in query_params) or
len(query_params) == 0):
context['show_results'] = False
else:
context['show_results'] = True
return context return context
@ -337,6 +361,13 @@ class RelatorioMateriasTramitacaoView(FilterView):
qr = self.request.GET.copy() qr = self.request.GET.copy()
context['filter_url'] = ('&' + qr.urlencode()) if len(qr) > 0 else '' context['filter_url'] = ('&' + qr.urlencode()) if len(qr) > 0 else ''
query_params = set(qr.keys())
if ((len(query_params) == 1 and 'iframe' in query_params) or
len(query_params) == 0):
context['show_results'] = False
else:
context['show_results'] = True
return context return context
@ -409,6 +440,13 @@ class RelatorioMateriasPorAnoAutorTipoView(FilterView):
qr = self.request.GET.copy() qr = self.request.GET.copy()
context['filter_url'] = ('&' + qr.urlencode()) if len(qr) > 0 else '' context['filter_url'] = ('&' + qr.urlencode()) if len(qr) > 0 else ''
query_params = set(qr.keys())
if ((len(query_params) == 1 and 'iframe' in query_params) or
len(query_params) == 0):
context['show_results'] = False
else:
context['show_results'] = True
if 'ano' in self.request.GET and self.request.GET['ano']: if 'ano' in self.request.GET and self.request.GET['ano']:
ano = int(self.request.GET['ano']) ano = int(self.request.GET['ano'])
context['relatorio'] = self.get_materias_autor_ano(ano) context['relatorio'] = self.get_materias_autor_ano(ano)
@ -447,6 +485,13 @@ class RelatorioMateriasPorAutorView(FilterView):
qr = self.request.GET.copy() qr = self.request.GET.copy()
context['filter_url'] = ('&' + qr.urlencode()) if len(qr) > 0 else '' context['filter_url'] = ('&' + qr.urlencode()) if len(qr) > 0 else ''
query_params = set(qr.keys())
if ((len(query_params) == 1 and 'iframe' in query_params) or
len(query_params) == 0):
context['show_results'] = False
else:
context['show_results'] = True
return context return context

31
sapl/materia/views.py

@ -138,6 +138,14 @@ class AdicionarVariasAutorias(PermissionRequiredForAppCrudMixin, FilterView):
context['title'] = _('Pesquisar Autores') context['title'] = _('Pesquisar Autores')
qr = self.request.GET.copy() qr = self.request.GET.copy()
context['filter_url'] = ('&' + qr.urlencode()) if len(qr) > 0 else '' context['filter_url'] = ('&' + qr.urlencode()) if len(qr) > 0 else ''
query_params = set(qr.keys())
if ((len(query_params) == 1 and 'iframe' in query_params) or
len(query_params) == 0):
context['show_results'] = False
else:
context['show_results'] = True
context['pk_materia'] = self.kwargs['pk'] context['pk_materia'] = self.kwargs['pk']
return context return context
@ -1507,6 +1515,13 @@ class MateriaLegislativaPesquisaView(FilterView):
context['filter_url'] = ('&' + qr.urlencode()) if len(qr) > 0 else '' context['filter_url'] = ('&' + qr.urlencode()) if len(qr) > 0 else ''
query_params = set(qr.keys())
if ((len(query_params) == 1 and 'iframe' in query_params) or
len(query_params) == 0):
context['show_results'] = False
else:
context['show_results'] = True
return context return context
@ -1608,6 +1623,14 @@ class DocumentoAcessorioEmLoteView(PermissionRequiredMixin, FilterView):
context['object_list'] = context['object_list'].order_by( context['object_list'] = context['object_list'].order_by(
'ano', 'numero') 'ano', 'numero')
context['filter_url'] = ('&' + qr.urlencode()) if len(qr) > 0 else '' context['filter_url'] = ('&' + qr.urlencode()) if len(qr) > 0 else ''
query_params = set(qr.keys())
if ((len(query_params) == 1 and 'iframe' in query_params) or
len(query_params) == 0):
context['show_results'] = False
else:
context['show_results'] = True
return context return context
def post(self, request, *args, **kwargs): def post(self, request, *args, **kwargs):
@ -1675,6 +1698,14 @@ class PrimeiraTramitacaoEmLoteView(PermissionRequiredMixin, FilterView):
'ano', 'numero') 'ano', 'numero')
context['filter_url'] = ('&' + qr.urlencode()) if len(qr) > 0 else '' context['filter_url'] = ('&' + qr.urlencode()) if len(qr) > 0 else ''
query_params = set(qr.keys())
if ((len(query_params) == 1 and 'iframe' in query_params) or
len(query_params) == 0):
context['show_results'] = False
else:
context['show_results'] = True
return context return context
def post(self, request, *args, **kwargs): def post(self, request, *args, **kwargs):

7
sapl/norma/views.py

@ -81,6 +81,13 @@ class NormaPesquisaView(FilterView):
context['filter_url'] = ('&' + qr.urlencode()) if len(qr) > 0 else '' context['filter_url'] = ('&' + qr.urlencode()) if len(qr) > 0 else ''
query_params = set(qr.keys())
if ((len(query_params) == 1 and 'iframe' in query_params) or
len(query_params) == 0):
context['show_results'] = False
else:
context['show_results'] = True
return context return context

16
sapl/protocoloadm/views.py

@ -212,6 +212,14 @@ class ProtocoloPesquisaView(PermissionRequiredMixin, FilterView):
numero_res=len(self.object_list) numero_res=len(self.object_list)
) )
qr = self.request.GET.copy()
query_params = set(qr.keys())
if ((len(query_params) == 1 and 'iframe' in query_params) or
len(query_params) == 0):
context['show_results'] = False
else:
context['show_results'] = True
return self.render_to_response(context) return self.render_to_response(context)
@ -564,6 +572,14 @@ class PesquisarDocumentoAdministrativoView(DocumentoAdministrativoMixin,
numero_res=len(self.object_list) numero_res=len(self.object_list)
) )
qr = self.request.GET.copy()
query_params = set(qr.keys())
if ((len(query_params) == 1 and 'iframe' in query_params) or
len(query_params) == 0):
context['show_results'] = False
else:
context['show_results'] = True
return self.render_to_response(context) return self.render_to_response(context)

8
sapl/sessao/views.py

@ -2455,6 +2455,14 @@ class PesquisarSessaoPlenariaView(FilterView):
numero_res=len(self.object_list) numero_res=len(self.object_list)
) )
qr = self.request.GET.copy()
query_params = set(qr.keys())
if ((len(query_params) == 1 and 'iframe' in query_params) or
len(query_params) == 0):
context['show_results'] = False
else:
context['show_results'] = True
return self.render_to_response(context) return self.render_to_response(context)

4
sapl/templates/base/RelatorioHistoricoTramitacao_filter.html

@ -3,11 +3,11 @@
{% load crispy_forms_tags %} {% load crispy_forms_tags %}
{% block base_content %} {% block base_content %}
{% if not filter_url %} {% if not show_results %}
{% crispy filter.form %} {% crispy filter.form %}
{% endif %} {% endif %}
{% if filter_url %} {% if show_results %}
<div class="actions btn-group pull-right" role="group"> <div class="actions btn-group pull-right" role="group">
<a href="{% url 'sapl.base:historico_tramitacoes' %}" class="btn btn-default">{% trans 'Fazer nova pesquisa' %}</a> <a href="{% url 'sapl.base:historico_tramitacoes' %}" class="btn btn-default">{% trans 'Fazer nova pesquisa' %}</a>
</div> </div>

4
sapl/templates/base/RelatorioMateriasPorAnoAutorTipo_filter.html

@ -3,11 +3,11 @@
{% load crispy_forms_tags %} {% load crispy_forms_tags %}
{% block base_content %} {% block base_content %}
{% if not filter_url %} {% if not show_results %}
{% crispy filter.form %} {% crispy filter.form %}
{% endif %} {% endif %}
{% if filter_url %} {% if show_results %}
<div class="actions btn-group pull-right" role="group"> <div class="actions btn-group pull-right" role="group">
<a href="{% url 'sapl.base:materia_por_ano_autor_tipo' %}" class="btn btn-default">{% trans 'Fazer nova pesquisa' %}</a> <a href="{% url 'sapl.base:materia_por_ano_autor_tipo' %}" class="btn btn-default">{% trans 'Fazer nova pesquisa' %}</a>
</div> </div>

4
sapl/templates/base/RelatorioMateriasPorAutor_filter.html

@ -3,11 +3,11 @@
{% load crispy_forms_tags %} {% load crispy_forms_tags %}
{% block base_content %} {% block base_content %}
{% if not filter_url %} {% if not show_results %}
{% crispy filter.form %} {% crispy filter.form %}
{% endif %} {% endif %}
{% if filter_url %} {% if show_results %}
<div class="actions btn-group pull-right" role="group"> <div class="actions btn-group pull-right" role="group">
<a href="{% url 'sapl.base:materia_por_autor' %}" class="btn btn-default">{% trans 'Fazer nova pesquisa' %}</a> <a href="{% url 'sapl.base:materia_por_autor' %}" class="btn btn-default">{% trans 'Fazer nova pesquisa' %}</a>
</div> </div>

4
sapl/templates/base/RelatorioPresencaSessao_filter.html

@ -4,11 +4,11 @@
{% load common_tags %} {% load common_tags %}
{% block base_content %} {% block base_content %}
{% if not filter_url %} {% if not show_results %}
{% crispy filter.form %} {% crispy filter.form %}
{% endif %} {% endif %}
{% if filter_url %} {% if show_results %}
<style type="text/css"> <style type="text/css">
.presenca_table td, th{ .presenca_table td, th{
text-align: center; text-align: center;

4
sapl/templates/materia/em_lote/acessorio.html

@ -3,11 +3,11 @@
{% block actions %}{% endblock %} {% block actions %}{% endblock %}
{% block detail_content %} {% block detail_content %}
{% if not filter_url %} {% if not show_results %}
{% crispy filter.form %} {% crispy filter.form %}
{% endif %} {% endif %}
{% if filter_url %} {% if show_results %}
{% if object_list.count > 0 %} {% if object_list.count > 0 %}
{% if object_list.count == 1 %} {% if object_list.count == 1 %}
<h3 style="text-align: right;">{% trans 'Pesquisa concluída com sucesso! Foi encontrada 1 matéria.'%}</h3> <h3 style="text-align: right;">{% trans 'Pesquisa concluída com sucesso! Foi encontrada 1 matéria.'%}</h3>

4
sapl/templates/materia/em_lote/tramitacao.html

@ -3,11 +3,11 @@
{% block actions %}{% endblock %} {% block actions %}{% endblock %}
{% block detail_content %} {% block detail_content %}
{% if not filter_url %} {% if not show_results %}
{% crispy filter.form %} {% crispy filter.form %}
{% endif %} {% endif %}
{% if filter_url %} {% if show_results %}
{% if object_list|length > 0 %} {% if object_list|length > 0 %}
{% if object_list|length == 1 %} {% if object_list|length == 1 %}
<h3 style="text-align: right;">{% trans 'Pesquisa concluída com sucesso! Foi encontrada 1 matéria.'%}</h3> <h3 style="text-align: right;">{% trans 'Pesquisa concluída com sucesso! Foi encontrada 1 matéria.'%}</h3>

6
sapl/templates/materia/materialegislativa_filter.html

@ -13,18 +13,18 @@
{% blocktrans with verbose_name=view.verbose_name %} Adicionar Matéria Legislativa {% endblocktrans %} {% blocktrans with verbose_name=view.verbose_name %} Adicionar Matéria Legislativa {% endblocktrans %}
</a> </a>
{% endif %} {% endif %}
{% if filter_url %} {% if show_results %}
<a href="{% url 'sapl.materia:pesquisar_materia' %}" class="btn btn-default">{% trans 'Fazer nova pesquisa' %}</a> <a href="{% url 'sapl.materia:pesquisar_materia' %}" class="btn btn-default">{% trans 'Fazer nova pesquisa' %}</a>
{% endif %} {% endif %}
</div> </div>
{% endblock %} {% endblock %}
{% block detail_content %} {% block detail_content %}
{% if not filter_url %} {% if not show_results %}
{% crispy filter.form %} {% crispy filter.form %}
{% endif %} {% endif %}
{% if filter_url %} {% if show_results %}
<table class="table table-striped table-bordered"> <table class="table table-striped table-bordered">
<thead class="thead-default"> <thead class="thead-default">
<tr><td><h3>{% trans "Resultados" %}</h3></td></tr> <tr><td><h3>{% trans "Resultados" %}</h3></td></tr>

6
sapl/templates/norma/normajuridica_filter.html

@ -14,7 +14,7 @@
{% blocktrans with verbose_name=view.verbose_name %} Adicionar Norma Jurídica {% endblocktrans %} {% blocktrans with verbose_name=view.verbose_name %} Adicionar Norma Jurídica {% endblocktrans %}
</a> </a>
{% endif %} {% endif %}
{% if filter_url %} {% if show_results %}
<a href="{% url 'sapl.norma:norma_pesquisa' %}" class="btn btn-default">{% trans 'Fazer nova pesquisa' %}</a> <a href="{% url 'sapl.norma:norma_pesquisa' %}" class="btn btn-default">{% trans 'Fazer nova pesquisa' %}</a>
{% endif %} {% endif %}
</div> </div>
@ -22,11 +22,11 @@
{% endblock %} {% endblock %}
{% block detail_content %} {% block detail_content %}
{% if not filter_url %} {% if not show_results %}
{% crispy filter.form %} {% crispy filter.form %}
{% endif %} {% endif %}
{% if filter_url %} {% if show_results %}
{% if page_obj|length %} {% if page_obj|length %}
<br /> <br />
{% if page_obj|length > 1 %} {% if page_obj|length > 1 %}

6
sapl/templates/protocoloadm/documentoadministrativo_filter.html

@ -13,7 +13,7 @@
</a> </a>
{% endif %} {% endif %}
</div> </div>
{% if filter_url %} {% if show_results %}
<div class="actions btn-group pull-right" role="group"> <div class="actions btn-group pull-right" role="group">
<a href="{% url 'sapl.protocoloadm:pesq_doc_adm' %}" class="btn btn-default">{% trans 'Fazer Nova Pesquisa' %}</a> <a href="{% url 'sapl.protocoloadm:pesq_doc_adm' %}" class="btn btn-default">{% trans 'Fazer Nova Pesquisa' %}</a>
</div> </div>
@ -21,9 +21,9 @@
{% endblock actions %} {% endblock actions %}
{% block detail_content %} {% block detail_content %}
{% if not filter_url %} {% crispy filter.form %} {% endif %} {% if not show_results %} {% crispy filter.form %} {% endif %}
{% if filter_url %} {% if show_results %}
<table class="table table-striped table-bordered"> <table class="table table-striped table-bordered">
<thead class="thead-default"><tr><td><h3>Resultados</h3></td></tr></thead> <thead class="thead-default"><tr><td><h3>Resultados</h3></td></tr></thead>
{% if page_obj|length %} {% if page_obj|length %}

8
sapl/templates/protocoloadm/protocolo_filter.html

@ -8,7 +8,7 @@
{{ block.super }} {{ block.super }}
{% if filter_url %} {% if show_results %}
<div class="actions btn-group pull-right grid-gutter-width-right " role="group"> <div class="actions btn-group pull-right grid-gutter-width-right " role="group">
<a href="{% url 'sapl.protocoloadm:protocolo' %}" class="btn btn-default">{% trans 'Fazer nova pesquisa' %}</a> <a href="{% url 'sapl.protocoloadm:protocolo' %}" class="btn btn-default">{% trans 'Fazer nova pesquisa' %}</a>
</div> </div>
@ -19,15 +19,15 @@
{% block detail_content %} {% block detail_content %}
<br> <br>
{% if not filter_url %} {% if not show_results %}
{% crispy filter.form %} {% crispy filter.form %}
{% endif %} {% endif %}
{% if filter_url %} {% if show_results %}
<table class="table table-striped table-bordered"> <table class="table table-striped table-bordered">
<thead class="thead-default"><tr><td><h3>Resultados</h3></td></tr></thead> <thead class="thead-default"><tr><td><h3>Resultados</h3></td></tr></thead>
{% if page_obj|length %} {% if page_obj|length %}
{% if filter_url %} {% if show_results %}
{% if numero_res > 1 %} {% if numero_res > 1 %}
<h3>Pesquisa concluída com sucesso! Foram encontrados {{numero_res}} protocolos.</h3> <h3>Pesquisa concluída com sucesso! Foram encontrados {{numero_res}} protocolos.</h3>
{% elif numero_res == 1 %} {% elif numero_res == 1 %}

2
sapl/templates/sessao/sessaoplenaria_filter.html

@ -15,7 +15,7 @@
{% block detail_content %} {% block detail_content %}
{% crispy filter.form %} {% crispy filter.form %}
{% if filter_url %} {% if show_results %}
<p></p> <p></p>
<table class="table table-striped table-hover"> <table class="table table-striped table-hover">
<thead class="thead-default"><tr><td><h3>Resultados</h3></td></tr></thead> <thead class="thead-default"><tr><td><h3>Resultados</h3></td></tr></thead>

Loading…
Cancel
Save