Browse Source

Feat(Legislativo):Baixar Materias Legislativas [AB#849]

pull/3858/head
root 8 months ago
parent
commit
47b46d4661
  1. 8
      sapl/materia/views.py
  2. 2
      sapl/templates/materia/materialegislativa_filter.html

8
sapl/materia/views.py

@ -2192,7 +2192,7 @@ class MateriaLegislativaPesquisaView(MultiFormatOutputMixin, FilterView):
paginate_by = 50
export_fields = [
'id', 'ano', 'numero', 'tipo__sigla', 'tipo__descricao', 'autoria', 'texto_original', 'ementa'
'id', 'ano', 'numero', 'tipo__sigla', 'tipo__descricao', 'autoria', 'texto_original', 'texto_original_url', 'ementa'
]
def hook_texto_original(self, obj):
@ -2201,6 +2201,12 @@ class MateriaLegislativaPesquisaView(MultiFormatOutputMixin, FilterView):
obj, dict) else obj["texto_original"]
return f'{url}/media/{texto_original}'
def hook_texto_original_url(self, obj):
"""
Hook para retornar a URL absoluta do texto_original (facilita download)
"""
return self.hook_texto_original(obj)
def hook_autoria(self, obj):
"""
Hook específico para pegar nomes dos autores (reverse query)

2
sapl/templates/materia/materialegislativa_filter.html

@ -4,6 +4,7 @@
{% load waffle_tags %}
{% load crispy_forms_tags common_tags%}
{% load webpack_static from webpack_loader %}
{% load static %}
{% block actions %}
@ -241,6 +242,7 @@
{% block table_content %}
{% endblock table_content %}
{% block extra_js %}
<script src="{% static 'js/materia_pesquisa_download_pdfs.js' %}"></script>
<script type="text/javascript" >
$( document ).ready(function() {

Loading…
Cancel
Save