diff options
Diffstat (limited to 'archaeological_files/templates/ishtar/wizard')
3 files changed, 186 insertions, 0 deletions
diff --git a/archaeological_files/templates/ishtar/wizard/file_confirm_wizard.html b/archaeological_files/templates/ishtar/wizard/file_confirm_wizard.html new file mode 100644 index 000000000..914a5198b --- /dev/null +++ b/archaeological_files/templates/ishtar/wizard/file_confirm_wizard.html @@ -0,0 +1,27 @@ +{% extends "ishtar/wizard/confirm_wizard.html" %} +{% load i18n %} + +{% block "warning_informations" %} +{% for file in numeric_reference_files %} +{% if forloop.first %} +<p class='alert'><i class="fa fa-exclamation-triangle" aria-hidden="true"></i> <label>{% trans "The following files have the same numeric index as this file:" %}</label></p> +<ul> +{% endif%} + <li>{{file}} <a href='#' onclick='load_window("{% url 'show-file' file.pk '' %}", "{{model_name}}");' class='display_details'><i class="fa fa-info-circle" aria-hidden="true"></i></a></li> +{% if forloop.last %} +</ul> +<hr/> +{% endif %} +{% endfor %} +{% for file in similar_files %} +{% if forloop.first %} +<p class='alert'><i class="fa fa-exclamation-triangle" aria-hidden="true"></i> <label>{% trans "The following files are in the same town and have parcels in common with this file:" %}</label></p> +<ul> +{% endif%} + <li>{{file}} <a href='#' onclick='load_window("{% url 'show-file' file.pk '' %}", "{{model_name}}");' class='display_details'><i class="fa fa-info-circle" aria-hidden="true"></i></a></li> +{% if forloop.last %} +</ul> +<hr/> +{% endif %} +{% endfor %} +{% endblock %} diff --git a/archaeological_files/templates/ishtar/wizard/wizard_instruction.html b/archaeological_files/templates/ishtar/wizard/wizard_instruction.html new file mode 100644 index 000000000..34db944aa --- /dev/null +++ b/archaeological_files/templates/ishtar/wizard/wizard_instruction.html @@ -0,0 +1,83 @@ +{% extends "ishtar/wizard/default_wizard.html" %} +{% load i18n range table_form %} +{% block form_detail %} + <div class="form-row"> + {% 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 %} + + <div class="form-group col-lg-6"> + <span class="required"> + <label class="required">{% trans "State of the file:" %}</label> + </span> + <div class="form-group col-lg-12 mb-0"> + <span><input type='radio' name='state' value='open' id='state-open'/> + <label for='state-open'>Dossier actif</label></span> + </div> + <div class="form-group col-lg-12"> + <span>{{wizard.form.end_date.errors}}<input type='radio' name='state' value='closed' id='state-closed'/> + <label for='state-closed'>Dossier clos / date de clôture</label> : {{wizard.form.end_date|safe}}</span> + </div> + </div> + {% with wizard.form.instruction_deadline as field %}{% with saisine_type_message as extra_field_label %} + {% include "blocks/bs_field_snippet.html" %} + {% endwith %}{% endwith %} + <div class="form-group col-lg-6"> + <span class="required"> + <label>{{wizard.form.numeric_reference.label}}{% trans ":" %}</label> + </span> + <div class="form-inline"> + {{wizard.form.numeric_reference.errors}} + {% if FILE_PREFIX %}<span class="pr-2">{{FILE_PREFIX}}</span>{% endif %} + <span class="pr-2">{{wizard.form.year|safe}}</span> - + <span class="pl-2">{{wizard.form.numeric_reference|safe}}</span> + </div> + </div> + </div> +{% 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 %} diff --git a/archaeological_files/templates/ishtar/wizard/wizard_person_orga.html b/archaeological_files/templates/ishtar/wizard/wizard_person_orga.html new file mode 100644 index 000000000..36f1aa4f8 --- /dev/null +++ b/archaeological_files/templates/ishtar/wizard/wizard_person_orga.html @@ -0,0 +1,76 @@ +{% extends "ishtar/wizard/default_wizard.html" %} +{% load i18n range table_form %} +{% block wizard_form %} +<script type='text/javascript'> +function update_form(){ + if ($('input[name="person_type"]:radio:checked').val() == 'corporation'){ + $('#natural_div').hide(); + $('#corporation_div').show(); + $('#orga-form').show(); + } else { + $('#natural_div').show(); + $('#corporation_div').hide(); + $('#orga-form').hide(); + } +} +$(function() { + update_form(); +}); +</script> +<form action="." method="post" name='wizard'{% if wizard.form.file_upload %} enctype="multipart/form-data"{% endif %}>{% csrf_token %} +<div class='form'> +{% if wizard.form.media %}{{ wizard.form.media }}{% endif %} +{{ wizard.management_form }} + +<table class='formset'> + <caption>Statut</caption> + <tr> + <th><label>{% trans "Corporation" %}</label></th> + <td><input type='radio' name='person_type' value='corporation'/></td> + </tr> + <tr> + <th><label>{% trans "Natural person" %}</label></th> + <td><input type='radio' name='person_type' value='natural'/></td> + </tr> +</table> + +<table id='corporation_div'> + {% if wizard.form.non_field_errors %}<tr class='errors'> + <td colspan='3'>{{wizard.form.non_field_errors}}</td> + </tr>{%endif%} + +{% block corporation %} +{% endblock %} +</table> +<div id='natural_div'> +<table> + {% if wizard.form.non_field_errors %}<tr class='errors'> + <td colspan='3'>{{wizard.form.non_field_errors}}</td> + </tr>{%endif%} + +{% block natural %} +{% endblock %} +</table> +</div> + +<div> +{% block otherfields %} +{% endblock %} +</div> +{% block extra_head_po %} +{% endblock %} + +<input type="hidden" name="{{ step_field }}" value="{{ step0 }}" /> +{{ previous_fields|safe }} + {% block "footer" %} + <div id="footer"> + {% block "validation_bar" %} + {% include 'ishtar/wizard/validation_bar.html' %} + {% endblock %} + {% include 'ishtar/blocks/footer.html' %} + </div> + {% endblock %} +</div> +</form> +{% endblock %} + |