{% extends "ishtar/wizard/default_wizard.html" %} {% load i18n range table_form %} {% block form_detail %}
{% with wizard.form.in_charge as field %} {% include "blocks/bs_field_snippet.html" %} {% endwith %} {% with wizard.form.related_file as field %} {% include "blocks/bs_field_snippet.html" %} {% endwith %} {% with wizard.form.comment as field %} {% include "blocks/bs_field_snippet.html" %} {% endwith %}
{{wizard.form.end_date.errors}} : {{wizard.form.end_date|safe}}
{% with wizard.form.instruction_deadline as field %}{% with saisine_type_message as extra_field_label %} {% include "blocks/bs_field_snippet.html" %} {% endwith %}{% endwith %}
{{wizard.form.numeric_reference.errors}} {% if FILE_PREFIX %}{{FILE_PREFIX}}{% endif %} {{wizard.form.year|safe}} - {{wizard.form.numeric_reference|safe}}
{% endblock %} {% block "js_extra_ready" %} if ($('#id_instruction-{{CURRENT_ACTION}}-end_date').val()){ $("#state-closed").prop('checked', true); } else { $("#state-open").prop('checked', true); } check_state = function(){ var state = $("input[name=state]:checked").val(); if (state == 'closed'){ $('#id_instruction-{{CURRENT_ACTION}}-end_date').focus(); $('#id_instruction-{{CURRENT_ACTION}}-end_date').prop('disabled', false); } else if (state == 'open'){ $('#id_instruction-{{CURRENT_ACTION}}-end_date').val(''); $('#id_instruction-{{CURRENT_ACTION}}-end_date').prop('disabled', true); } }; $('input[name=state]').click(check_state); check_state(); $('#submit_form').click(function(){ var state = $("input[name=state]:checked").val(); if (state == 'closed'){ if (!$('#id_instruction-{{CURRENT_ACTION}}-end_date').val()){ alert("{% trans 'You must select a closing date.' %}") return false; } return true; } else if (state == 'open'){ return true; } else { alert("{% trans 'You must select a state for this file.' %}") return false; } return true; }); {% endblock %}