Browse Source

Arrumando formatação do relatorio

Co-authored-by: Vinícius Cantuária <cantuariavc@gmail.com>
pull/2816/head
ulyssesBML 7 years ago
parent
commit
f3c09fc16e
  1. 6
      sapl/protocoloadm/views.py
  2. 2
      sapl/static/sapl/css/relatorio.css
  3. 82
      sapl/templates/relatorios/relatorio_doc_administrativos.html

6
sapl/protocoloadm/views.py

@ -932,6 +932,10 @@ class PesquisarDocumentoAdministrativoView(DocumentoAdministrativoMixin,
length = self.object_list.filter(restrito=False).count() length = self.object_list.filter(restrito=False).count()
else: else:
length = self.object_list.count() length = self.object_list.count()
is_relatorio = url!='' and request.GET.get('relatorio',None)
max_elementos_pdf = 10000
self.paginate_by = max_elementos_pdf if is_relatorio else 10
context = self.get_context_data(filter=self.filterset, context = self.get_context_data(filter=self.filterset,
filter_url=url, filter_url=url,
numero_res=length numero_res=length
@ -939,7 +943,7 @@ class PesquisarDocumentoAdministrativoView(DocumentoAdministrativoMixin,
context['show_results'] = show_results_filter_set( context['show_results'] = show_results_filter_set(
self.request.GET.copy()) self.request.GET.copy())
if url!='' and request.GET.get('relatorio',None): if is_relatorio:
return relatorio_doc_administrativos(request,context) return relatorio_doc_administrativos(request,context)
else: else:
return self.render_to_response(context) return self.render_to_response(context)

2
sapl/static/sapl/css/relatorio.css

@ -16,7 +16,7 @@ h3 {
page-break-after: avoid; page-break-after: avoid;
} }
p { p, a {
font-size: 10pt; font-size: 10pt;
text-align: justify; text-align: justify;
text-justify: inter-word; text-justify: inter-word;

82
sapl/templates/relatorios/relatorio_doc_administrativos.html

@ -1,6 +1,7 @@
{% load i18n %} {% load i18n %}
{% load crispy_forms_tags %}
{% load common_tags %} {% load common_tags %}
{% load static %}
<head> <head>
<style> <style>
@ -38,52 +39,47 @@
} }
} }
</style> </style>
<link rel="stylesheet" href="{% static '/sapl/css/relatorio.css'%}">
</head> </head>
<body> <body>
<table class="table table-striped table-bordered"> <h2>Documentos Administrativos</h2>
<thead class="thead-default"><tr><td><h3>Resultados</h3></td></tr></thead> {% if page_obj|length %}
{% if page_obj|length %} <h3>Número de documentos: {{numero_res}}</h3>
{% for d in page_obj %} {% for d in page_obj %}
{% if request.user.is_anonymous and not d.restrito or not request.user.is_anonymous%} <div style="border-top: 1px solid black;margin-bottom:0.3cm">
<tr> {% if request.user.is_anonymous and not d.restrito or not request.user.is_anonymous%}
<td> <strong><a href="{% url 'sapl.protocoloadm:documentoadministrativo_detail' d.id %}">{{d.tipo.sigla}} {{d.numero}}/{{d.ano}} - {{d.tipo}}</strong></a></br>
<strong><a href="{% url 'sapl.protocoloadm:documentoadministrativo_detail' d.id %}">{{d.tipo.sigla}} {{d.numero}}/{{d.ano}} - {{d.tipo}}</strong></a></br> <strong>Interessado:</strong>&nbsp;{{ d.interessado|default_if_none:"Não informado"}}
<strong>Interessado:</strong>&nbsp;{{ d.interessado|default_if_none:"Não informado"}} </br>
</br> <strong>Assunto:</strong>&nbsp;<a>{{ d.assunto|safe}}</a>
<strong>Assunto:</strong>&nbsp;{{ d.assunto|safe }} </br>
</br> {% if d.protocolo %}
{% if d.protocolo %} <strong>Protocolo:</strong>&nbsp;<a href="{% url 'sapl.protocoloadm:protocolo_mostrar' d.protocolo.id %}">{{ d.protocolo}}</a></br>
<strong>Protocolo:</strong>&nbsp;<a href="{% url 'sapl.protocoloadm:protocolo_mostrar' d.protocolo.id %}">{{ d.protocolo}}</a></br> {% endif %}
{% endif %} {% define d.tramitacaoadministrativo_set.last as tram %}
{% define d.tramitacaoadministrativo_set.last as tram %} {% if tram.unidade_tramitacao_destino %}
{% if tram.unidade_tramitacao_destino %} <strong>Localização Atual:</strong> &nbsp;{{tram.unidade_tramitacao_destino}}
<strong>Localização Atual:</strong> &nbsp;{{tram.unidade_tramitacao_destino}} </br>
</br> <strong>Status:</strong> {{tram.status}}
<strong>Status:</strong> {{tram.status}} </br>
</br> {% endif %}
{% define d.documentoacessorioadministrativo_set.all as acess %}
{% if d.documentoacessorioadministrativo_set.all.exists %}
<strong>Documentos Acessórios:</strong>
<a href="{% url 'sapl.protocoloadm:documentoacessorioadministrativo_list' d.id %}">
{{ d.documentoacessorioadministrativo_set.all.count }}
</a>
</br>
{% endif %}
{% if d.tramitacao and mail_service_configured %}
<a href="{% url 'sapl.protocoloadm:acompanhar_documento' d.id %}">Acompanhar Documento</a>
{% endif %} {% endif %}
{% define d.documentoacessorioadministrativo_set.all as acess %} {% endif %}
{% if d.documentoacessorioadministrativo_set.all.exists %} </div>
<strong>Documentos Acessórios:</strong>
<a href="{% url 'sapl.protocoloadm:documentoacessorioadministrativo_list' d.id %}">
{{ d.documentoacessorioadministrativo_set.all.count }}
</a>
</br>
{% endif %}
{% if d.texto_integral %}
<strong><a href="{{ d.texto_integral.url }}">Texto Integral</a></strong></br>
{% endif %}
{% if d.tramitacao and mail_service_configured %}
<a href="{% url 'sapl.protocoloadm:acompanhar_documento' d.id %}">Acompanhar Documento</a>
{% endif %}
</td>
</tr> {% endfor %}
{% else %}
<h3>Nenhum documento encontrado com essas especificações</h3>
{% endif %} {% endif %}
{% endfor %}
{% else %}
<tr><td><h3>Nenhum documento encontrado com essas especificações</h3></tr>
{% endif %}
</table>
</body> </body>
Loading…
Cancel
Save