From 97454480d3eea87550180db82f361d651f07e448 Mon Sep 17 00:00:00 2001 From: Eliseu Egewarth Date: Mon, 30 Oct 2017 13:50:15 -0200 Subject: [PATCH] 1557 fix registro duplicado (#1564) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Bloqueia ressubmissão de votação nominal (via JS) * Fix #1563 --- sapl/crispy_layout_mixin.py | 2 +- sapl/templates/sessao/votacao/nominal.html | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/sapl/crispy_layout_mixin.py b/sapl/crispy_layout_mixin.py index c7421287a..06808e5c3 100644 --- a/sapl/crispy_layout_mixin.py +++ b/sapl/crispy_layout_mixin.py @@ -38,7 +38,7 @@ def form_actions(more=[], save_label=_('Salvar')): return FormActions( Submit('salvar', save_label, css_class='pull-right', # para impedir resubmissão do form - onclick='this.disabled=true;'), + onclick='this.form.submit();this.disabled=true;'), *more) diff --git a/sapl/templates/sessao/votacao/nominal.html b/sapl/templates/sessao/votacao/nominal.html index 838747999..ad494dae5 100644 --- a/sapl/templates/sessao/votacao/nominal.html +++ b/sapl/templates/sessao/votacao/nominal.html @@ -69,5 +69,10 @@ function voltar() { window.history.back(); } + + $(window).on('beforeunload', function () { + $("input[type=submit], input[type=button]").prop("disabled", "disabled"); + }); + {% endblock extra_js%}