mirror of https://github.com/interlegis/sapl.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
826 B
34 lines
826 B
{% extends "crud/form.html" %}
|
|
{% load i18n %}
|
|
{% load crispy_forms_tags %}
|
|
{% load common_tags %}
|
|
|
|
{% block extra_js %}
|
|
<script language="Javascript">
|
|
|
|
$(document).ready(function() {
|
|
function recuperar_norma() {
|
|
var orgao = $("#id_orgao").val()
|
|
var tipo = $("#id_tipo").val()
|
|
var numero = $("#id_numero").val()
|
|
var ano = $("#id_ano").val()
|
|
|
|
if (tipo && numero && ano) {
|
|
$.get(
|
|
"{% url 'sapl.norma:recuperar_norma' %}",
|
|
{
|
|
orgao: orgao,
|
|
tipo: tipo,
|
|
numero: numero,
|
|
ano: ano
|
|
},
|
|
function(data, status) {
|
|
$("#id_ementa").val(data.ementa);
|
|
}
|
|
);
|
|
}
|
|
}
|
|
$("#id_tipo, #id_numero, #id_ano, #id_orgao").change(recuperar_norma);
|
|
});
|
|
</script>
|
|
{% endblock %}
|
|
|