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.
42 lines
1.0 KiB
42 lines
1.0 KiB
{% extends "crud/detail.html" %}
|
|
{% load i18n %}
|
|
{% load crispy_forms_tags %}
|
|
|
|
{% block actions %}<!-- Remvoer botões 'Editar' e 'Excluir' -->{% endblock %}
|
|
|
|
{% block detail_content %}
|
|
{% crispy form %}
|
|
{% endblock %}
|
|
|
|
{% block extra_js %}
|
|
<script type="text/javascript">
|
|
|
|
function disable_fields() {
|
|
$("#id_tipo_materia").val("");
|
|
$("#id_numero_materia").val("");
|
|
$("#id_ano_materia").val("");
|
|
|
|
$("#id_tipo_materia").attr("disabled", "disabled");
|
|
$("#id_numero_materia").attr("disabled", "disabled");
|
|
$("#id_ano_materia").attr("disabled", "disabled");
|
|
}
|
|
|
|
function enable_fields() {
|
|
$("#id_tipo_materia").removeAttr('disabled');
|
|
$("#id_numero_materia").removeAttr('disabled');
|
|
$("#id_ano_materia").removeAttr('disabled');
|
|
}
|
|
|
|
$(function () {
|
|
disable_fields();
|
|
$("#id_tipo").change(function() {
|
|
if ($("#id_tipo").val() == 9) { // parecer
|
|
enable_fields();
|
|
}
|
|
else {
|
|
disable_fields();
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
{% endblock %}
|