From 91ce78e008ca03f86d771219791b9a3096a5eab8 Mon Sep 17 00:00:00 2001 From: ulyssesBML Date: Tue, 20 Oct 2020 14:23:14 -0300 Subject: [PATCH] =?UTF-8?q?Add=20observa=C3=A7=C3=A3o=20para=20leitura=20e?= =?UTF-8?q?m=20bloco?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/sessao/views.py | 1 + .../sessao/votacao/votacao_bloco.html | 39 ++++++++++++++++++- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/sapl/sessao/views.py b/sapl/sessao/views.py index fcb8d5336..664045298 100755 --- a/sapl/sessao/views.py +++ b/sapl/sessao/views.py @@ -4157,6 +4157,7 @@ class LeituraEmBloco(PermissionRequiredForAppCrudMixin, TemplateView): rl = RegistroLeitura(materia=ordem.materia,ordem=ordem,user=request.user,ip=get_client_ip(request)) elif origem == 'expediente': rl = RegistroLeitura(materia=ordem.materia,expediente=ordem,user=request.user,ip=get_client_ip(request)) + rl.observacao = self.request.POST.get('observacao',"") rl.save() ordem.save() diff --git a/sapl/templates/sessao/votacao/votacao_bloco.html b/sapl/templates/sessao/votacao/votacao_bloco.html index 855b7a443..a1b997249 100644 --- a/sapl/templates/sessao/votacao/votacao_bloco.html +++ b/sapl/templates/sessao/votacao/votacao_bloco.html @@ -99,7 +99,30 @@ Voltar {% endif %} - + Registrar votação + + {% endif %} @@ -155,7 +178,8 @@ document.getElementById('but_reg').style.display = ''; document.getElementById('nenhuma_mat').style.display = 'none'; } - + + $("#but_reg").text("Registrar Votação") if(tipo_votacao == "1"){ $('#form').attr("action", "{% url 'sapl.sessao:votacaoblocosimb' pk %}") } @@ -163,8 +187,19 @@ $('#form').attr("action", "{% url 'sapl.sessao:votacaobloconom' pk %}") } else{ + $("#but_reg").text("Registrar Leitura") $('#form').attr("action", "{% url 'sapl.sessao:leitura_em_bloco' pk %}") } } + + function submit_button(){ + var radioValue = $("input[name='tipo_votacao']:checked").val(); + if (radioValue == 4){ + $('#leituraModal').modal('show') + } + else{ + $("#form").submit() + } + } {% endblock extra_js%}