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. 24
      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;

24
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,20 +39,20 @@
} }
} }
</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 %}
<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%} {% 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><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;{{ d.assunto|safe }} <strong>Assunto:</strong>&nbsp;<a>{{ d.assunto|safe}}</a>
</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>
@ -71,19 +72,14 @@
</a> </a>
</br> </br>
{% endif %} {% 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 %} {% if d.tramitacao and mail_service_configured %}
<a href="{% url 'sapl.protocoloadm:acompanhar_documento' d.id %}">Acompanhar Documento</a> <a href="{% url 'sapl.protocoloadm:acompanhar_documento' d.id %}">Acompanhar Documento</a>
{% endif %} {% endif %}
</td>
</tr>
{% endif %} {% endif %}
</div>
{% endfor %} {% endfor %}
{% else %} {% else %}
<tr><td><h3>Nenhum documento encontrado com essas especificações</h3></tr> <h3>Nenhum documento encontrado com essas especificações</h3>
{% endif %} {% endif %}
</table>
</body> </body>
Loading…
Cancel
Save