Browse Source

Fixes #2072 (#2075)

pull/2074/head
Edward 7 years ago
committed by GitHub
parent
commit
06e5f72c5d
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      sapl/comissoes/forms.py
  2. 12
      sapl/templates/norma/normajuridica_filter.html
  3. 9
      sapl/templates/norma/normajuridica_form.html

2
sapl/comissoes/forms.py

@ -100,7 +100,7 @@ class ParticipacaoCreateForm(forms.ModelForm):
exclude(id__in=id_part)
eligible = self.verifica()
result = list(set(qs) & set(eligible))
if not cmp(result, eligible): # se igual a 0 significa que o qs e o eli são iguais!
if result == eligible:
self.fields['parlamentar'].queryset = qs
else:
ids = [e.id for e in eligible]

12
sapl/templates/norma/normajuridica_filter.html

@ -84,6 +84,18 @@
<h2>Nenhuma norma encontrada com essas especificações</h2>
{% endif %}
{% endif %}
<script type="text/javascript">
$(document).ready(function() {
var numeroField = $("#id_numero");
numeroField.keyup(function() {
var numero = numeroField.val();
if (numero.startsWith("0")) {
numeroField.val(numero.replace(/^0+/, ''));
}
});
});
</script>
{% endblock detail_content %}
{% block table_content %}

9
sapl/templates/norma/normajuridica_form.html

@ -41,6 +41,15 @@
for (i = 0; i < fields.length; i++) {
$(fields[i]).change(recuperar_norma);
}
var numeroField = $("#id_numero");
numeroField.keyup(function() {
var numero = numeroField.val();
if (numero.startsWith("0")) {
numeroField.val(numero.replace(/^0+/, ''));
}
});
</script>
{% endblock %}

Loading…
Cancel
Save