summaryrefslogtreecommitdiff
path: root/archaeological_files_pdl/templates
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_files_pdl/templates')
-rw-r--r--archaeological_files_pdl/templates/ishtar/blocks/JQueryCorporationPerson.js2
-rw-r--r--archaeological_files_pdl/templates/ishtar/blocks/JQueryNaturalPerson.js2
-rw-r--r--archaeological_files_pdl/templates/ishtar/blocks/JQueryPersonOrga.js65
-rw-r--r--archaeological_files_pdl/templates/ishtar/wizard/wizard_generalcontractor.html15
-rw-r--r--archaeological_files_pdl/templates/ishtar/wizard/wizard_instruction.html106
-rw-r--r--archaeological_files_pdl/templates/ishtar/wizard/wizard_person_orga.html66
-rw-r--r--archaeological_files_pdl/templates/ishtar/wizard/wizard_planningservice.html15
-rw-r--r--archaeological_files_pdl/templates/ishtar/wizard/wizard_preventiveplanning.html80
8 files changed, 351 insertions, 0 deletions
diff --git a/archaeological_files_pdl/templates/ishtar/blocks/JQueryCorporationPerson.js b/archaeological_files_pdl/templates/ishtar/blocks/JQueryCorporationPerson.js
new file mode 100644
index 000000000..3eb375167
--- /dev/null
+++ b/archaeological_files_pdl/templates/ishtar/blocks/JQueryCorporationPerson.js
@@ -0,0 +1,2 @@
+var current_status = 'corporation';
+{% include "ishtar/blocks/JQueryPersonOrga.js" %}
diff --git a/archaeological_files_pdl/templates/ishtar/blocks/JQueryNaturalPerson.js b/archaeological_files_pdl/templates/ishtar/blocks/JQueryNaturalPerson.js
new file mode 100644
index 000000000..fc4b9a90c
--- /dev/null
+++ b/archaeological_files_pdl/templates/ishtar/blocks/JQueryNaturalPerson.js
@@ -0,0 +1,2 @@
+var current_status = 'natural';
+{% include "ishtar/blocks/JQueryPersonOrga.js" %}
diff --git a/archaeological_files_pdl/templates/ishtar/blocks/JQueryPersonOrga.js b/archaeological_files_pdl/templates/ishtar/blocks/JQueryPersonOrga.js
new file mode 100644
index 000000000..c151a5e4d
--- /dev/null
+++ b/archaeological_files_pdl/templates/ishtar/blocks/JQueryPersonOrga.js
@@ -0,0 +1,65 @@
+person_save_callback = function(item_id, lbl){
+ var url = {{edit_source}};
+ $('#id_{{field_id}}').val(null);
+ $('#id_select_{{field_id}}').val(lbl);
+ if (item_id){
+ url = {{edit_source}}+item_id;
+ $('#id_{{field_id}}').val(item_id);
+ }
+ $("#id_select_{{field_id}}").trigger('autocompletechange');
+ $.get(url , function( data ) {
+ $( "#div-{{field_id}}" ).html( data );
+ });
+};
+
+edit_url = {{edit_source}};
+parent_id = "{{field_id}}";
+
+person_new_callback = function(){
+ var url = {{edit_source}};
+ $('#id_{{field_id}}').val(null);
+ $('#id_select_{{field_id}}').val(null);
+}
+
+$(function() {
+ var $radios = $('input:radio[name=person_type]');
+ if($radios.is(':checked') === false) {
+ $radios.filter('[value='+ current_status +']').prop('checked', true);
+ }
+
+ $radios.change(function(){
+ var loc = window.location;
+ window.location = loc.protocol + '//' + loc.host + loc.pathname + "?status=" + $('input:radio[name=person_type]:checked').val();
+ });
+
+ $("#id_select_{{field_id}}").autocomplete({
+ source: {{source}},
+ select: function( event, ui ) {
+ var url = {{edit_source}};
+ if(ui.item){
+ url = {{edit_source}}+ui.item.id;
+ $('#id_{{field_id}}').val(ui.item.id);
+ } else {
+ $('#id_{{field_id}}').val(null);
+ }
+ $.get(url , function( data ) {
+ $( "#div-{{field_id}}" ).html( data );
+ });
+ },
+ minLength: 2{% if options %},
+ {{options}}
+ {% endif %}
+ });
+
+ $.get( {{edit_source}}{% if selected %}+'{{selected}}'{% endif %}, function( data ) {
+ $( "#div-{{field_id}}" ).html( data );
+ });
+
+ $('#id_select_{{field_id}}').live('click', function(){
+ $('#id_{{field_id}}').val(null);
+ $('#id_select_{{field_id}}').val(null);
+ $.get( {{edit_source}}, function( data ) {
+ $( "#div-{{field_id}}" ).html( data );
+ });
+ });
+});
diff --git a/archaeological_files_pdl/templates/ishtar/wizard/wizard_generalcontractor.html b/archaeological_files_pdl/templates/ishtar/wizard/wizard_generalcontractor.html
new file mode 100644
index 000000000..e43e336c4
--- /dev/null
+++ b/archaeological_files_pdl/templates/ishtar/wizard/wizard_generalcontractor.html
@@ -0,0 +1,15 @@
+{% extends "ishtar/wizard/wizard_person_orga.html" %}
+
+{% block corporation %}
+ <tr class='required'>
+ <th>{{ wizard.form.raw_general_contractor.label_tag }}</th>
+ <td> {{ wizard.form.raw_general_contractor.errors }}{{wizard.form.raw_general_contractor|safe}}</td>
+ </tr>
+{% endblock %}
+
+{% block natural %}
+ <tr class='required'>
+ <th>{{ wizard.form.general_contractor.label_tag }}</th>
+ <td> {{ wizard.form.general_contractor.errors }}{{wizard.form.general_contractor|safe}}</td>
+ </tr>
+{% endblock %}
diff --git a/archaeological_files_pdl/templates/ishtar/wizard/wizard_instruction.html b/archaeological_files_pdl/templates/ishtar/wizard/wizard_instruction.html
new file mode 100644
index 000000000..4162a3764
--- /dev/null
+++ b/archaeological_files_pdl/templates/ishtar/wizard/wizard_instruction.html
@@ -0,0 +1,106 @@
+{% extends "ishtar/wizard/default_wizard.html" %}
+{% load i18n range table_form %}
+{% block wizard_form %}
+<form action="." method="post" name='wizard'{% if wizard.form.file_upload %} enctype="multipart/form-data"{% endif %}>{% csrf_token %}
+<div class='form'>
+{{ wizard.form.media }}
+{{ wizard.management_form }}
+
+<table>
+
+<tr class='required'>
+ <th><label for="id_instruction-{{CURRENT_ACTION}}-in_charge">Dossier suivi par</label></th>
+</tr>
+<tr class='required'>
+ <td>{{wizard.form.in_charge.errors}}{{wizard.form.in_charge|safe}}</td>
+</tr>
+
+<tr>
+ <th><label for="id_instruction-{{CURRENT_ACTION}}-related_file">Dossier lié à</label></th>
+</tr>
+<tr>
+ <td>{{wizard.form.related_file|safe}}</td>
+</tr>
+
+<tr>
+ <th><label for="id_instruction-{{CURRENT_ACTION}}-comment">Commentaire</label></th>
+</tr>
+<tr>
+ <td>{{wizard.form.comment|safe}}</td>
+</tr>
+
+<tr class='required'>
+ <th><label>État du dossier</label></th>
+</tr>
+<tr>
+ <td><input type='radio' name='state' value='open' id='state-open'/> <label for='state-open'>Dossier actif</label></td>
+</tr>
+<tr>
+ <td><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}}</td>
+</tr>
+
+<tr class='required'>
+ <th><label for="id_instruction-{{CURRENT_ACTION}}-instruction_deadline">Date limite d'instruction</label></th>
+</tr>
+<tr class='required'>
+ <td>{{wizard.form.instruction_deadline.errors}}{{wizard.form.instruction_deadline|safe}}</td>
+</tr>
+
+<tr class='required'>
+ <th><label for="id_instruction-{{CURRENT_ACTION}}-year">{{wizard.form.numeric_reference.label}}</label></th>
+</tr>
+<tr>
+ <td>{{wizard.form.numeric_reference.errors}}SRA <span class='small'>{{wizard.form.year|safe}}</span> - <span class='small'>{{wizard.form.numeric_reference|safe}}</span></td>
+</tr>
+</table>
+
+<input type="hidden" name="{{ step_field }}" value="{{ step0 }}" />
+{{ previous_fields|safe }}
+{% block "validation_bar" %}
+{% include 'ishtar/wizard/validation_bar.html' %}
+{% endblock %}
+</div>
+</form>
+<script type='text/javascript'>
+$(function(){
+
+ 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("Vous devez sélectionner une date de clôture.")
+ return false;
+ }
+ return true;
+ } else if (state == 'open'){
+ return true;
+ } else {
+ alert("Vous devez choisir un état pour ce dossier.")
+ return false;
+ }
+ return true;
+ });
+});
+</script>
+{% endblock %}
diff --git a/archaeological_files_pdl/templates/ishtar/wizard/wizard_person_orga.html b/archaeological_files_pdl/templates/ishtar/wizard/wizard_person_orga.html
new file mode 100644
index 000000000..91dd7e042
--- /dev/null
+++ b/archaeological_files_pdl/templates/ishtar/wizard/wizard_person_orga.html
@@ -0,0 +1,66 @@
+{% 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();
+ } else {
+ $('#natural_div').show();
+ $('#corporation_div').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>
+
+{% block otherfields %}
+{% endblock %}
+
+<input type="hidden" name="{{ step_field }}" value="{{ step0 }}" />
+{{ previous_fields|safe }}
+{% block "validation_bar" %}
+{% include 'ishtar/wizard/validation_bar.html' %}
+{% endblock %}
+</div>
+</form>
+{% endblock %}
+
diff --git a/archaeological_files_pdl/templates/ishtar/wizard/wizard_planningservice.html b/archaeological_files_pdl/templates/ishtar/wizard/wizard_planningservice.html
new file mode 100644
index 000000000..29bc2397c
--- /dev/null
+++ b/archaeological_files_pdl/templates/ishtar/wizard/wizard_planningservice.html
@@ -0,0 +1,15 @@
+{% extends "ishtar/wizard/wizard_person_orga.html" %}
+
+{% block corporation %}
+ <tr class='required'>
+ <th>{{ wizard.form.raw_town_planning_service.label_tag }}</th>
+ <td> {{ wizard.form.raw_town_planning_service.errors }}{{wizard.form.raw_town_planning_service|safe}}</td>
+ </tr>
+{% endblock %}
+
+{% block natural %}
+ <tr class='required'>
+ <th>{{ wizard.form.responsible_town_planning_service.label_tag }}</th>
+ <td> {{ wizard.form.responsible_town_planning_service.errors }}{{wizard.form.responsible_town_planning_service|safe}}</td>
+ </tr>
+{% endblock %}
diff --git a/archaeological_files_pdl/templates/ishtar/wizard/wizard_preventiveplanning.html b/archaeological_files_pdl/templates/ishtar/wizard/wizard_preventiveplanning.html
new file mode 100644
index 000000000..66569a66d
--- /dev/null
+++ b/archaeological_files_pdl/templates/ishtar/wizard/wizard_preventiveplanning.html
@@ -0,0 +1,80 @@
+{% extends "ishtar/wizard/default_wizard.html" %}
+{% load i18n range table_form %}
+{% block wizard_form %}
+<form action="." method="post" name='wizard'{% if wizard.form.file_upload %} enctype="multipart/form-data"{% endif %}>{% csrf_token %}
+<div class='form'>
+{{ wizard.form.media }}
+{{ wizard.management_form }}
+
+<table>
+
+<tr class='required'>
+ <th><label for="id_preventiveplanning-{{CURRENT_ACTION}}-name">Nom de l'aménagement</label></th>
+</tr>
+<tr class='required'>
+ <td>{{wizard.form.name|safe}}</td>
+</tr>
+
+</table>
+
+<h4>Localisation</h4>
+<table>
+
+{% if wizard.form.main_town.errors %}<tr>
+ <td colspan="2">{{wizard.form.main_town.errors}}</td>
+</tr>{% endif %}
+
+<tr>
+ <td>{{wizard.form.main_town|safe}}</td>
+</tr>
+
+<tr>
+ <th colspan='2'><label for="id_preventiveplanning-{{CURRENT_ACTION}}-locality">Lieu-dit</label></th>
+</tr>
+<tr>
+ <td colspan='2'>{{wizard.form.locality|safe}}</td>
+</tr>
+
+<tr>
+ <th colspan='2'><label for="id_preventiveplanning-{{CURRENT_ACTION}}-address">Adresse</label></th>
+</tr>
+<tr>
+ <td colspan='2'>{{wizard.form.address|safe}}</td>
+</tr>
+
+<tr>
+ <th colspan='2'><label for="id_preventiveplanning-{{CURRENT_ACTION}}-postal_code">Code postal</label></th>
+</tr>
+<tr>
+ <td colspan='2'>{{wizard.form.postal_code|safe}}</td>
+</tr>
+
+</table>
+
+<h4>Surfaces</h4>
+<table>
+
+<tr>
+ <th><label for="id_preventiveplanning-{{CURRENT_ACTION}}-total_surface">Surface totale des terrains</label></th>
+</tr>
+<tr>
+ <td>{{wizard.form.total_surface|safe}}</td>
+</tr>
+
+<tr>
+ <th><label for="id_preventiveplanning-{{CURRENT_ACTION}}-total_developed_surface">Surface totale aménagée</label></th>
+</tr>
+<tr>
+ <td>{{wizard.form.total_developed_surface|safe}}</td>
+</tr>
+
+</table>
+
+<input type="hidden" name="{{ step_field }}" value="{{ step0 }}" />
+{{ previous_fields|safe }}
+{% block "validation_bar" %}
+{% include 'ishtar/wizard/validation_bar.html' %}
+{% endblock %}
+</div>
+</form>
+{% endblock %}