diff --git a/sapl/sessao/forms.py b/sapl/sessao/forms.py index 9ff12378c..ba10e5b2a 100644 --- a/sapl/sessao/forms.py +++ b/sapl/sessao/forms.py @@ -349,14 +349,6 @@ class ExpedienteMateriaForm(ModelForm): else: cleaned_data['materia'] = materia - exists = self._model.objects.filter( - sessao_plenaria=sessao, - materia=materia).exists() - - if exists and not self.instance.pk: - msg = _('Essa matéria já foi cadastrada.') - raise ValidationError(msg) - return cleaned_data def save(self, commit=False): diff --git a/sapl/templates/sessao/expedientemateria_form.html b/sapl/templates/sessao/expedientemateria_form.html index e90ec63ff..a8fc8ced6 100644 --- a/sapl/templates/sessao/expedientemateria_form.html +++ b/sapl/templates/sessao/expedientemateria_form.html @@ -4,54 +4,101 @@ {% load common_tags %} {% block extra_js %} + + $('#id_apenas_leitura').change( function(event) { + $('#div_id_tipo_votacao').toggle(); + if($('#id_apenas_leitura').prop('checked')){ + $("select[name='tipo_votacao']").append(new Option('Leitura', '4')); + $("select[name='tipo_votacao']").val('4'); + } else { + $("select[name='tipo_votacao']").children("option[value='4']").remove(); + $("select[name='tipo_votacao']").val('1'); + } + }); + $("#fundo_modal, #close_model_btn").click( function() { $("#fundo_modal").hide(); }); + $("#modal").click( function(e) { e.stopPropagation(); }); + }); + {% endblock %}