Edward
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
22 additions and
1 deletions
-
sapl/comissoes/forms.py
-
sapl/templates/norma/normajuridica_filter.html
-
sapl/templates/norma/normajuridica_form.html
|
|
@ -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] |
|
|
|
|
|
@ -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 %} |
|
|
|
|
|
@ -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 %} |
|
|
|