From d49ad30e1161d94d9c8ea23a974b468a55ab33e2 Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Thu, 18 Oct 2018 10:42:24 -0300 Subject: [PATCH 01/38] Usa buffer inteiro p python-magic ao exportar do zope --- sapl/legacy/scripts/exporta_zope/exporta_zope.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapl/legacy/scripts/exporta_zope/exporta_zope.py b/sapl/legacy/scripts/exporta_zope/exporta_zope.py index 682296f4b..bec8595cf 100755 --- a/sapl/legacy/scripts/exporta_zope/exporta_zope.py +++ b/sapl/legacy/scripts/exporta_zope/exporta_zope.py @@ -93,7 +93,7 @@ def br(obj): def guess_extension(fullname, buffer): # um corte de apenas 1024 impediu a detecção correta de .docx - mime = magic.from_buffer(buffer[:4096], mime=True) + mime = magic.from_buffer(buffer, mime=True) extensao = EXTENSOES.get(mime) if extensao is not None: return extensao From caec5dbed878905e08e8da38216594eeae60bf2b Mon Sep 17 00:00:00 2001 From: Edward Date: Fri, 9 Nov 2018 16:11:24 -0200 Subject: [PATCH 02/38] Fixes #2362 (#2365) --- sapl/norma/forms.py | 8 +++++--- .../migrations/0015_auto_20181109_1422.py | 20 +++++++++++++++++++ sapl/norma/models.py | 2 +- sapl/templates/norma/layouts.yaml | 4 ++-- 4 files changed, 28 insertions(+), 6 deletions(-) create mode 100644 sapl/norma/migrations/0015_auto_20181109_1422.py diff --git a/sapl/norma/forms.py b/sapl/norma/forms.py index d4f0046a6..674e1b9a8 100644 --- a/sapl/norma/forms.py +++ b/sapl/norma/forms.py @@ -64,7 +64,7 @@ class NormaFilterSet(django_filters.FilterSet): class Meta: model = NormaJuridica - fields = ['tipo', 'numero', 'ano', 'data', + fields = ['tipo', 'numero', 'ano', 'data', 'data_vigencia', 'data_publicacao', 'ementa', 'assuntos'] def __init__(self, *args, **kwargs): @@ -73,13 +73,14 @@ class NormaFilterSet(django_filters.FilterSet): row1 = to_row([('tipo', 4), ('numero', 4), ('ano', 4)]) row2 = to_row([('data', 6), ('data_publicacao', 6)]) row3 = to_row([('ementa', 6), ('assuntos', 6)]) - row4 = to_row([('o',6), ('indexacao', 6)]) + row4 = to_row([('data_vigencia', 12)]) + row5 = to_row([('o',6), ('indexacao', 6)]) self.form.helper = FormHelper() self.form.helper.form_method = 'GET' self.form.helper.layout = Layout( Fieldset(_('Pesquisa de Norma'), - row1, row2, row3, row4, + row1, row2, row3, row4, row5, form_actions(label='Pesquisar')) ) @@ -120,6 +121,7 @@ class NormaJuridicaForm(ModelForm): 'numero_materia', 'ano_materia', 'data_publicacao', + 'data_vigencia', 'veiculo_publicacao', 'pagina_inicio_publicacao', 'pagina_fim_publicacao', diff --git a/sapl/norma/migrations/0015_auto_20181109_1422.py b/sapl/norma/migrations/0015_auto_20181109_1422.py new file mode 100644 index 000000000..e6550dcb8 --- /dev/null +++ b/sapl/norma/migrations/0015_auto_20181109_1422.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.8 on 2018-11-09 16:22 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('norma', '0014_auto_20181008_1655'), + ] + + operations = [ + migrations.AlterField( + model_name='normajuridica', + name='data_vigencia', + field=models.DateField(blank=True, null=True, verbose_name='Data Fim Vigência'), + ), + ] diff --git a/sapl/norma/models.py b/sapl/norma/models.py index 46f34a0ef..fd06b553e 100644 --- a/sapl/norma/models.py +++ b/sapl/norma/models.py @@ -119,7 +119,7 @@ class NormaJuridica(models.Model): assuntos = models.ManyToManyField( AssuntoNorma, blank=True, verbose_name=_('Assuntos')) - data_vigencia = models.DateField(blank=True, null=True) + data_vigencia = models.DateField(blank=True, null=True, verbose_name=_('Data Fim Vigência')) timestamp = models.DateTimeField(null=True) texto_articulado = GenericRelation( diff --git a/sapl/templates/norma/layouts.yaml b/sapl/templates/norma/layouts.yaml index d881ae186..295ef62d5 100644 --- a/sapl/templates/norma/layouts.yaml +++ b/sapl/templates/norma/layouts.yaml @@ -17,7 +17,7 @@ NormaJuridica: - tipo numero ano - data esfera_federacao complemento - materia - - data_publicacao veiculo_publicacao pagina_inicio_publicacao pagina_fim_publicacao + - data_publicacao veiculo_publicacao data_vigencia pagina_inicio_publicacao pagina_fim_publicacao - texto_integral - ementa - indexacao @@ -35,7 +35,7 @@ NormaJuridicaCreate: - tipo ano numero - data esfera_federacao complemento - tipo_materia numero_materia ano_materia - - data_publicacao veiculo_publicacao pagina_inicio_publicacao pagina_fim_publicacao + - data_publicacao veiculo_publicacao data_vigencia pagina_inicio_publicacao pagina_fim_publicacao - texto_integral - ementa - indexacao From d443a9b3354150a93490d6d1895d11985c187844 Mon Sep 17 00:00:00 2001 From: Leandro Roberto Date: Mon, 12 Nov 2018 09:10:16 -0200 Subject: [PATCH 03/38] corrige css e js de checkbox e radio --- sapl/static/js/app.js | 8 - sapl/static/styles/app.scss | 14 +- sapl/templates/sessao/presenca.html | 152 +++++++++---------- sapl/templates/sessao/presenca_ordemdia.html | 144 +++++++++--------- 4 files changed, 152 insertions(+), 166 deletions(-) diff --git a/sapl/static/js/app.js b/sapl/static/js/app.js index c6a4d4259..cc9c773ce 100644 --- a/sapl/static/js/app.js +++ b/sapl/static/js/app.js @@ -192,20 +192,12 @@ function OptionalCustomFrontEnd() { _label = $('').insertBefore(this) } } - /*var _controls = _label.closest('.controls'); - - if (!_controls.length) { - _controls = $('
').insertBefore(_label) - _controls.append(_label) - }*/ if (this.type === "checkbox") { - _label.addClass('checkbox-inline'); _label.prepend(_this); _this.checkbox(); } else if (this.type === "radio") { - _label.addClass('radio-inline'); _label.prepend(_this); _this.radio(); diff --git a/sapl/static/styles/app.scss b/sapl/static/styles/app.scss index 7f50c9339..710d98833 100644 --- a/sapl/static/styles/app.scss +++ b/sapl/static/styles/app.scss @@ -229,14 +229,16 @@ nav { } label { - padding: 5px; + padding: 0; + line-height: 2.7; + padding-left: 36px; .icons { - top: 5px; + top: 8px; left: 8px; } - &.checkbox-inline, &.radio-inline { - padding: 8px; - padding-left: 36px; + + &.checkbox-inline, &.radio-inline, { + padding-right: 8px; .icons { top: 8px; left: 8px; @@ -244,7 +246,7 @@ nav { } } .checkbox, .radio, .checkbox-inline, .radio-inline { - margin: 0; + margin: 0; &:hover { background-color: #d6e1e5; } diff --git a/sapl/templates/sessao/presenca.html b/sapl/templates/sessao/presenca.html index 3b9ebf541..202966c3a 100644 --- a/sapl/templates/sessao/presenca.html +++ b/sapl/templates/sessao/presenca.html @@ -5,91 +5,83 @@ {% block actions %}{% endblock %} {% block detail_content %} - {% if perms|get_add_perm:view %} -
- {% csrf_token %} - -
-
- -
-
- -
-
-
- -
-
- -
- -
- {% for parlamentar, check in view.get_presencas %} - {% if parlamentar.ativo %} -
- -
- {% else %} - - {% endif %} - {% endfor %} -
- -
- -
- -{% else %} -
-

Parlamentares presentes

-
-
- +
+ {% csrf_token %} +
+ +
+
+
+ +
+
+
{% for parlamentar, check in view.get_presencas %} - {% if check %} -
-
-
- {% endif %} + {% if parlamentar.ativo %} + + {% else %} + + {% endif %} {% endfor %} +
+
+ +
-{% endif %} - +{% else %} +
+
+

Parlamentares presentes +

+
+
+ +{% for parlamentar, check in view.get_presencas %} +{% if check %} +
+
+ +
+
+{% endif %} +{% endfor %} +{% endif %} {% endblock detail_content %} {% block extra_js %} - -{% endblock %} + +{% endblock %} \ No newline at end of file diff --git a/sapl/templates/sessao/presenca_ordemdia.html b/sapl/templates/sessao/presenca_ordemdia.html index ccc730bcd..98f184aa7 100644 --- a/sapl/templates/sessao/presenca_ordemdia.html +++ b/sapl/templates/sessao/presenca_ordemdia.html @@ -7,90 +7,90 @@ {% block detail_content %} {% if perms|get_add_perm:view %} -
- {% csrf_token %} - -
-
- -
+ + {% csrf_token %} +
+
+
+
-
+
-
-
- -
+
+
+
+
-
- -
- {% for parlamentar, check in view.get_presencas_ordem %} - {% if parlamentar.ativo %} -
- -
- {% else %} - - {% endif %} - {% endfor %} -
+
-
- - +
+ {% for parlamentar, check in view.get_presencas_ordem %} + {% if parlamentar.ativo %} + + {% else %} + + {% endif %} + {% endfor %} +
+
+ + {% else %} -
-

Parlamentares presentes

-
-
- - {% for parlamentar, check in view.get_presencas_ordem %} - {% if check %} -
-
-
- {% endif %} - {% endfor %} +
+
+

Parlamentares presentes +

+
+
+ +{% for parlamentar, check in view.get_presencas_ordem %} +{% if check %} +
+
+
+{% endif %} +{% endfor %} {% endif %} {% endblock detail_content %} {% block extra_js %} - -{% endblock %} + +{% endblock %} \ No newline at end of file From 4509367ad69a177c9fe0bcd747f6e252b579a38b Mon Sep 17 00:00:00 2001 From: Leandro Roberto Date: Mon, 12 Nov 2018 09:35:18 -0200 Subject: [PATCH 04/38] =?UTF-8?q?ajuste=20css=20presen=C3=A7as=20de=20sess?= =?UTF-8?q?=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/static/styles/app.scss | 26 ++++++++++++ sapl/templates/sessao/presenca.html | 42 ++++++++++++-------- sapl/templates/sessao/presenca_ordemdia.html | 24 ++++++----- 3 files changed, 65 insertions(+), 27 deletions(-) diff --git a/sapl/static/styles/app.scss b/sapl/static/styles/app.scss index 710d98833..57736d3a7 100644 --- a/sapl/static/styles/app.scss +++ b/sapl/static/styles/app.scss @@ -222,12 +222,38 @@ nav { border: 1px solid #d6e1e5; border-radius: 4px; min-height: 20px; + + + .checkbox, .radio, .checkbox-inline, .radio-inline { + padding: 8px 8px 8px 36px; + margin: 0; + line-height: 1.6; + display: block; + + &:hover { + background-color: #d6e1e5; + } + .icons { + top: auto; + left: 8px; + } + } + .checkbox-inline, .radio-inline { + display: inline-block; + } + .help-block { margin: $grid-gutter-width / 2; padding: $grid-gutter-width / 2; border: 2px dashed #d6e1e5; } +} + .controls-radio-checkbox__old { + padding: 0px; + border: 1px solid #d6e1e5; + border-radius: 4px; + min-height: 20px; label { padding: 0; line-height: 2.7; diff --git a/sapl/templates/sessao/presenca.html b/sapl/templates/sessao/presenca.html index 202966c3a..99015f5f3 100644 --- a/sapl/templates/sessao/presenca.html +++ b/sapl/templates/sessao/presenca.html @@ -9,32 +9,40 @@
{% csrf_token %}
- +
+ +

- +
+ +

{% for parlamentar, check in view.get_presencas %} {% if parlamentar.ativo %} - +
+ +
{% else %} - + {% endif %} {% endfor %}
diff --git a/sapl/templates/sessao/presenca_ordemdia.html b/sapl/templates/sessao/presenca_ordemdia.html index 98f184aa7..2264108bc 100644 --- a/sapl/templates/sessao/presenca_ordemdia.html +++ b/sapl/templates/sessao/presenca_ordemdia.html @@ -33,17 +33,21 @@
{% for parlamentar, check in view.get_presencas_ordem %} {% if parlamentar.ativo %} - +
+ +
{% else %} - + {% endif %} {% endfor %}
From 6f6240002046affe2fc0cc5f8682ccb977dae47a Mon Sep 17 00:00:00 2001 From: Talitha Pumar Date: Mon, 12 Nov 2018 13:19:54 -0200 Subject: [PATCH 05/38] =?UTF-8?q?Fix=20#2366=20atalho=20para=20vota=C3=A7?= =?UTF-8?q?=C3=A3o=20nas=20telas=20de=20ordem=20dia=20e=20expediente=20(#2?= =?UTF-8?q?370)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/templates/sessao/expedientemateria_list.html | 6 ++++++ sapl/templates/sessao/ordemdia_list.html | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/sapl/templates/sessao/expedientemateria_list.html b/sapl/templates/sessao/expedientemateria_list.html index 51f2815d5..f372abcb0 100644 --- a/sapl/templates/sessao/expedientemateria_list.html +++ b/sapl/templates/sessao/expedientemateria_list.html @@ -22,6 +22,12 @@ var pk_sessao = {{root_pk}}; var pk_list = {{ object_list|to_list_pk|safe }}; + $(document).on('keyup', (e) => { + if (e.keyCode == 86){ + window.open("{% url 'sapl.painel:voto_individual' %}",'Voto Individual','width=1000, height=800, scrollbars=yes'); + }; + }); + $('tbody').sortable({ start: function(event, ui) { diff --git a/sapl/templates/sessao/ordemdia_list.html b/sapl/templates/sessao/ordemdia_list.html index 3ae16e2e8..6ed8d6120 100644 --- a/sapl/templates/sessao/ordemdia_list.html +++ b/sapl/templates/sessao/ordemdia_list.html @@ -22,6 +22,12 @@ var pk_sessao = {{root_pk}}; var pk_list = {{ object_list|to_list_pk|safe }}; + $(document).on('keyup', (e) => { + if (e.keyCode == 86){ + window.open("{% url 'sapl.painel:voto_individual' %}",'Voto Individual','width=1000, height=800, scrollbars=yes'); + }; + }); + $('tbody').sortable({ start: function(event, ui) { From a5fbdae72f53cc13db17a1b19f90bccfb4475822 Mon Sep 17 00:00:00 2001 From: Victor Fabre Date: Mon, 12 Nov 2018 13:20:18 -0200 Subject: [PATCH 06/38] fix #2368 (#2369) --- sapl/materia/views.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sapl/materia/views.py b/sapl/materia/views.py index 5fec4a2f7..476ff292b 100644 --- a/sapl/materia/views.py +++ b/sapl/materia/views.py @@ -2179,6 +2179,10 @@ class EtiquetaPesquisaView(PermissionRequiredMixin, FormView): if context['quantidade'] > 20: materias = materias[:20] + for m in materias: + if len(m.ementa) > 100: + m.ementa = m.ementa[0:99] + "[...]" + context['materias'] = materias return gerar_pdf_impressos(self.request, context, From ed154dd77240f6562281ab7cb4268040698ea01b Mon Sep 17 00:00:00 2001 From: Victor Fabre Date: Mon, 12 Nov 2018 13:20:36 -0200 Subject: [PATCH 07/38] Fix #2360 (#2367) --- sapl/materia/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sapl/materia/views.py b/sapl/materia/views.py index 476ff292b..ebce51a5d 100644 --- a/sapl/materia/views.py +++ b/sapl/materia/views.py @@ -2271,7 +2271,8 @@ class FichaSelecionaView(PermissionRequiredMixin, FormView): self.messages.add_message(self.request, messages.INFO, mensagem) return self.render_to_response(context) - + if len(materia.ementa) > 301: + materia.ementa = materia.ementa[0:300] + '[...]' context['materia'] = materia context['despachos'] = materia.despachoinicial_set.all().values_list( 'comissao__nome', flat=True) From edaab5eb0ada0c3979e8142eb8f1f27d455b4d76 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Mon, 12 Nov 2018 13:24:49 -0200 Subject: [PATCH 08/38] HOT-FIX: diminui tamanho da logo em comprovante de protocolo --- sapl/templates/protocoloadm/comprovante.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sapl/templates/protocoloadm/comprovante.html b/sapl/templates/protocoloadm/comprovante.html index 795eecb9c..9dcf9a638 100644 --- a/sapl/templates/protocoloadm/comprovante.html +++ b/sapl/templates/protocoloadm/comprovante.html @@ -3,7 +3,7 @@ {% load static %} {% block detail_content %} -