Browse Source
Merge branch '3.1.x' into ajuste_data_votacoes_nominais
pull/3834/head
cristian-longhi
3 weeks ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with
19 additions and
20 deletions
-
sapl/relatorios/forms.py
-
sapl/relatorios/views.py
-
sapl/templates/relatorios/RelatorioMateriasPorAutor_filter.html
-
sapl/templates/relatorios/RelatorioNormasPorAutor_filter.html
-
sapl/templates/relatorios/blocos_sessao_plenaria/ocorrencias_da_sessao.html
|
|
|
@ -641,6 +641,8 @@ class RelatorioMateriasPorAutorFilterSet(django_filters.FilterSet): |
|
|
|
@property |
|
|
|
def qs(self): |
|
|
|
parent = super().qs |
|
|
|
if not self.data.get('autoria__autor'): |
|
|
|
return parent.none() |
|
|
|
return parent.distinct().order_by('-ano', '-numero', 'tipo', 'autoria__autor', '-autoria__primeiro_autor') |
|
|
|
|
|
|
|
class Meta(FilterOverridesMetaMixin): |
|
|
|
@ -752,7 +754,9 @@ class RelatorioNormasPorAutorFilterSet(django_filters.FilterSet): |
|
|
|
@property |
|
|
|
def qs(self): |
|
|
|
parent = super().qs |
|
|
|
return parent.distinct().filter(autorianorma__primeiro_autor=True) \ |
|
|
|
if not self.data.get('autorianorma__autor'): |
|
|
|
return parent.none() |
|
|
|
return parent.distinct() \ |
|
|
|
.order_by('autorianorma__autor', '-autorianorma__primeiro_autor', 'tipo', '-ano', '-numero') |
|
|
|
|
|
|
|
class Meta(FilterOverridesMetaMixin): |
|
|
|
|
|
|
|
@ -2662,7 +2662,6 @@ class RelatorioMateriasPorAutorView(RelatorioMixin, FilterView): |
|
|
|
return context |
|
|
|
|
|
|
|
qs = context['object_list'] |
|
|
|
context['materias_resultado'] = list(collections.OrderedDict.fromkeys(qs)) |
|
|
|
context['qtdes'] = num_materias_por_tipo(qs) |
|
|
|
|
|
|
|
qr = self.request.GET.copy() |
|
|
|
@ -2677,9 +2676,9 @@ class RelatorioMateriasPorAutorView(RelatorioMixin, FilterView): |
|
|
|
context['tipo'] = '' |
|
|
|
if self.request.GET['autoria__autor']: |
|
|
|
autor = int(self.request.GET['autoria__autor']) |
|
|
|
context['autor'] = (str(Autor.objects.get(id=autor))) |
|
|
|
context['autor'] = Autor.objects.get(id=autor) |
|
|
|
else: |
|
|
|
context['autor'] = '' |
|
|
|
context['autor'] = None |
|
|
|
context['periodo'] = ( |
|
|
|
self.request.GET['data_apresentacao_0'] + |
|
|
|
' - ' + self.request.GET['data_apresentacao_1']) |
|
|
|
@ -2923,9 +2922,9 @@ class RelatorioNormasPorAutorView(RelatorioMixin, FilterView): |
|
|
|
|
|
|
|
if self.request.GET['autorianorma__autor']: |
|
|
|
autor = int(self.request.GET['autorianorma__autor']) |
|
|
|
context['autor'] = (str(Autor.objects.get(id=autor))) |
|
|
|
context['autor'] = Autor.objects.get(id=autor) |
|
|
|
else: |
|
|
|
context['autor'] = '' |
|
|
|
context['autor'] = None |
|
|
|
context['periodo'] = ( |
|
|
|
self.request.GET['data_0'] + |
|
|
|
' - ' + self.request.GET['data_1']) |
|
|
|
|
|
|
|
@ -17,7 +17,7 @@ |
|
|
|
 Tipo de matéria: {{ tipo }}<br /> |
|
|
|
 Data de apresentação: {{ periodo }}<br /><br /><br/> |
|
|
|
|
|
|
|
{% if materias_resultado %} |
|
|
|
{% if object_list %} |
|
|
|
<table class="table table-bordered table-hover"> |
|
|
|
<thead class="thead-default" > |
|
|
|
<tr class="active"> |
|
|
|
@ -43,10 +43,10 @@ |
|
|
|
<tr class="active"> |
|
|
|
<th width="10%">Matéria</th> |
|
|
|
<th>Ementa</th> |
|
|
|
<th width="20%">Autor(es)</th> |
|
|
|
<th width="20%">Coautor(es)</th> |
|
|
|
</tr> |
|
|
|
</thead> |
|
|
|
{% for materia in materias_resultado %} |
|
|
|
{% for materia in object_list %} |
|
|
|
<tbody> |
|
|
|
<tr> |
|
|
|
<td> |
|
|
|
@ -56,11 +56,9 @@ |
|
|
|
</td> |
|
|
|
<td>{% autoescape off %}{{materia.ementa}}<br>{{materia.observacao}}{% endautoescape %}</td> |
|
|
|
<td> |
|
|
|
{% for autor in materia.autoria_set.all %} |
|
|
|
{% if not autor.primeiro_autor %} |
|
|
|
{{ autor.autor }}<br /> |
|
|
|
{% else %} |
|
|
|
<u><b><i>{{ autor.autor }}</i></b></u><br /> |
|
|
|
{% for autoria in materia.autoria_set.all %} |
|
|
|
{% if autoria.autor != autor %} |
|
|
|
{{ autoria.autor }}<br /> |
|
|
|
{% endif %} |
|
|
|
{% endfor %} |
|
|
|
</td> |
|
|
|
|
|
|
|
@ -54,13 +54,11 @@ |
|
|
|
</a></td> |
|
|
|
<td>{% autoescape off %}{{norma.ementa}}<br>{{norma.observacao}}{% endautoescape %}</td> |
|
|
|
<td> |
|
|
|
{% if norma.autorianorma_set.first != norma.autorianorma_set.last %} |
|
|
|
{% for autor in norma.autorianorma_set.all %} |
|
|
|
{% if not autor.primeiro_autor %} |
|
|
|
{{ autor.autor }}<br /> |
|
|
|
{% for autoria in norma.autorianorma_set.all %} |
|
|
|
{% if autoria.autor != autor %} |
|
|
|
{{ autoria.autor }}<br /> |
|
|
|
{% endif %} |
|
|
|
{% endfor %} |
|
|
|
{% endif %} |
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
</tbody> |
|
|
|
|
|
|
|
@ -1,4 +1,4 @@ |
|
|
|
<h2 class="gray-title">Ocorrências da Sessão</h2> |
|
|
|
{% for o in lst_ocorrencias%} |
|
|
|
<p>{{o|striptags|safe}}</p> |
|
|
|
<p>{{o.conteudo|striptags|safe}}</p> |
|
|
|
{% endfor %} |
|
|
|
|