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()
else:
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,
filter_url=url,
numero_res=length
@ -939,7 +943,7 @@ class PesquisarDocumentoAdministrativoView(DocumentoAdministrativoMixin,
context['show_results'] = show_results_filter_set(
self.request.GET.copy())
if url!='' and request.GET.get('relatorio',None):
if is_relatorio:
return relatorio_doc_administrativos(request,context)
else:
return self.render_to_response(context)

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

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

82
sapl/templates/relatorios/relatorio_doc_administrativos.html

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