Browse Source

Gerar e aprimorar pdf de extrato

Colocando nome completo nos extratos e acresentando cargos nas assinaturas.
Fix #2514
Fix #2506

Refatorando classe ResumoView (extraindo metodos)

Adicionando testes a refatoração feita na classe ResumoView

Iniciando a geração do pdf de extrato da reunião

Aprimorando relatorio do extrato da reunião;
Fix #2514

Colocando numero de votos

Arrumando header e tabelas do relatorio de extrato

Colocando rodape no documento de extrato

Melhorando formatação da documentação de extrato de reunião

Melhorando assinaturas e removendo codigo morto

Adicionando nome de parlaentares nos votos nominais Fix #2514 Fix #2502 Fix #2506
pull/2539/head
ulyssesBML 7 years ago
committed by VictorFabreF
parent
commit
4e05de5584
  1. 3
      sapl/relatorios/views.py
  2. 5
      sapl/static/sapl/css/header-relatorio.css
  3. 2
      sapl/templates/relatorios/header_ata.html
  4. 1
      sapl/templates/relatorios/relatorio_ata.html

3
sapl/relatorios/views.py

@ -1224,7 +1224,6 @@ def make_pdf(base_url,main_template,header_template,main_css='',header_css=''):
# Template of header # Template of header
html = HTML(base_url=base_url,string=header_template) html = HTML(base_url=base_url,string=header_template)
header = html.render(stylesheets=[CSS(string='@page {size:A4; margin:1cm;}')]) header = html.render(stylesheets=[CSS(string='@page {size:A4; margin:1cm;}')])
header_page = header.pages[0] header_page = header.pages[0]
header_body = get_page_body(header_page._page_box.all_children()) header_body = get_page_body(header_page._page_box.all_children())
header_body = header_body.copy_with_children(header_body.all_children()) header_body = header_body.copy_with_children(header_body.all_children())
@ -1259,12 +1258,12 @@ def resumo_ata_pdf(request,pk):
context.update({'object':sessao_plenaria}) context.update({'object':sessao_plenaria})
context.update({'data': dt.today().strftime('%d/%m/%Y')}) context.update({'data': dt.today().strftime('%d/%m/%Y')})
context.update({'rodape':rodape}) context.update({'rodape':rodape})
header_context = {"casa":casa, 'logotipo':casa.logotipo, 'MEDIA_URL': MEDIA_URL} header_context = {"casa":casa, 'logotipo':casa.logotipo, 'MEDIA_URL': MEDIA_URL}
html_template = render_to_string('relatorios/relatorio_ata.html',context) html_template = render_to_string('relatorios/relatorio_ata.html',context)
html_header = render_to_string('relatorios/header_ata.html', header_context) html_header = render_to_string('relatorios/header_ata.html', header_context)
pdf_file = make_pdf(base_url=base_url,main_template=html_template,header_template=html_header) pdf_file = make_pdf(base_url=base_url,main_template=html_template,header_template=html_header)
response = HttpResponse(content_type='application/pdf;') response = HttpResponse(content_type='application/pdf;')

5
sapl/static/sapl/css/header-relatorio.css

@ -43,4 +43,9 @@ ul {
html body section dt img { html body section dt img {
max-width:80px; max-width:80px;
margin-left: 20px; margin-left: 20px;
margin-left: 50px;
}
h3 {
font-size: 12pt;
color: #6e6e6e;
} }

2
sapl/templates/relatorios/header_ata.html

@ -1,6 +1,7 @@
{% load common_tags %} {% load common_tags %}
{% load render_bundle from webpack_loader %} {% load render_bundle from webpack_loader %}
{% load webpack_static from webpack_loader %} {% load webpack_static from webpack_loader %}
{% load static %} {% load static %}
<!DOCTYPE html> <!DOCTYPE html>
<meta charset="utf-8"> <meta charset="utf-8">
@ -21,6 +22,7 @@
<ul> <ul>
<li style="margin-top:10px"><h2>{{casa}}</h2></li> <li style="margin-top:10px"><h2>{{casa}}</h2></li>
<li><h3>Sistema de Apoio ao Processo Legislativo</h3></li> <li><h3>Sistema de Apoio ao Processo Legislativo</h3></li>
</ul> </ul>
</dd> </dd>
</dl> </dl>

1
sapl/templates/relatorios/relatorio_ata.html

@ -50,6 +50,7 @@
<div style="padding:5px;margin-top:80px;border-top: 1px solid black;"> <div style="padding:5px;margin-top:80px;border-top: 1px solid black;">
<legend >{{texto_assinatura}}</legend> <legend >{{texto_assinatura}}</legend>
<table style="margin-top:20px"> <table style="margin-top:20px">

Loading…
Cancel
Save