summaryrefslogtreecommitdiff
path: root/ishtar_common/templates/ishtar/wizard
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common/templates/ishtar/wizard')
-rw-r--r--ishtar_common/templates/ishtar/wizard/confirm_wizard.html34
-rw-r--r--ishtar_common/templates/ishtar/wizard/default_wizard.html40
-rw-r--r--ishtar_common/templates/ishtar/wizard/parcels_wizard.html27
-rw-r--r--ishtar_common/templates/ishtar/wizard/search.html20
-rw-r--r--ishtar_common/templates/ishtar/wizard/validation_bar.html24
-rw-r--r--ishtar_common/templates/ishtar/wizard/wizard_done.html14
-rw-r--r--ishtar_common/templates/ishtar/wizard/wizard_person.html131
7 files changed, 184 insertions, 106 deletions
diff --git a/ishtar_common/templates/ishtar/wizard/confirm_wizard.html b/ishtar_common/templates/ishtar/wizard/confirm_wizard.html
index 7339af9a8..1128e9561 100644
--- a/ishtar_common/templates/ishtar/wizard/confirm_wizard.html
+++ b/ishtar_common/templates/ishtar/wizard/confirm_wizard.html
@@ -3,25 +3,31 @@
{% load range %}
{% block content %}
<h2>{{wizard_label}}</h2>
-<form action="." method="post">{% csrf_token %}
-<ul id='form_path'>
-{% for step in previous_steps %}
- <li><button name="form_prev_step" value="{{forloop.counter0}}">{{step}}</button></li>
-{% endfor %}
- <li class='current'><a href='#'>{{current_step_label}}</a></li>
-</ul>
-</form>
+
+{% include "ishtar/blocks/wizard_breadcrumb.html" %}
+
<form action="." method="post">{% csrf_token %}
<div class='form'>
{% block "warning_informations" %}{% endblock %}
<p>{%if confirm_msg %}{{confirm_msg|safe}}{%else%}{% trans "You have entered the following informations:" %}{%endif%}</p>
{% for form_label, form_data in datas %}
- <table class='confirm'>
- <caption>{{form_label}}</caption>
- {% for data in form_data %}
- <tr{%if data.2%} class='{{data.2}}'{%endif%}><th>{{data.0}}</th><td>{{data.1}}</td></tr>
- {% endfor %}
- </table>
+
+ <div class="card">
+ {% if form_label %}
+ <div class="card-header">
+ {{form_label}}
+ </div>{% endif %}
+ <div class="card-body form-row">
+ <table class='table'>
+ {% for data in form_data %}
+ <tr{%if data.2%} class='{{data.2}}'{%endif%}><th>{{data.0}}</th><td>{{data.1}}</td></tr>
+ {% endfor %}
+ </table>
+
+ </div>
+ </div>
+
+
{% endfor %}
{{wizard.management_form}}
{%if not wizard.form.is_hidden %}
diff --git a/ishtar_common/templates/ishtar/wizard/default_wizard.html b/ishtar_common/templates/ishtar/wizard/default_wizard.html
index 19076b0de..a7a705f59 100644
--- a/ishtar_common/templates/ishtar/wizard/default_wizard.html
+++ b/ishtar_common/templates/ishtar/wizard/default_wizard.html
@@ -5,21 +5,13 @@
{% endblock %}
{% block content %}
{% block wizard_head %}
-<h2>{{wizard_label}}</h2>
-<form action="." method="post">{% csrf_token %}
-<ul id='form_path'>
-{% for step in previous_steps %}
- <li><button class='change_step' name="form_prev_step" value="{{forloop.counter0}}">{{step}}</button></li>
-{% endfor %}
- <li class='current'><a href='#'>{{current_step_label}}</a></li>
-{% for step in next_steps %}
- <li><button class='change_step' name="form_prev_step" value="{{forloop.counter|add:previous_step_counter}}">{{step}}</button></li>
-{% endfor %}
-</ul>
-</form>
+<h3>{{wizard_label}}</h3>
+
+{% include "ishtar/blocks/wizard_breadcrumb.html" %}
+
{% endblock %}
{% block wizard_form %}
-<form action="." method="post" name='wizard'{% if wizard.form.file_upload %} enctype="multipart/form-data"{% endif %}>{% csrf_token %}
+<form action="." class='wizard-form' id="wizard-form" 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 }}
@@ -27,18 +19,19 @@
{% block form_detail %}
{% if wizard.form.forms %}
{{ wizard.form.management_form }}
-<div class='top_button'><input type="submit" id="submit_form" value="{% trans "Validate" %}"/></div>
-<table class='formset'>
- {%if wizard.form.non_form_errors%}<tr class='error'><th colspan='2'>{{wizard.form.non_form_errors}}</th></tr>{%endif%}
+ {% if wizard.form.non_form_errors %}
+ <div class="alert alert-danger" role="alert">
+ {{wizard.form.non_form_errors}}
+ </div>
+ {% endif %}
{% for formsetform in wizard.form.forms %}
- {% table_form formsetform %}
+ {% bs_form formsetform %}
{% endfor %}
- <tr class='modify'><td colspan="2"><button name="formset_modify" value="{{wizard.steps.current}}">{% trans "Add/Modify" %}</button></td></tr></li>
-</table>
+ <button class="btn btn-success" name="formset_modify" value="{{wizard.steps.current}}">
+ {% trans "Add/Modify" %}
+ </button>
{% else %}
-{% if not is_search %}<table>{% endif %}
-{% table_form wizard.form %}
-{% if not is_search %}</table>{% endif %}
+ {% bs_form wizard.form %}
{% endif %}
{% endblock %}
<input type="hidden" name="{{ step_field }}" value="{{ step0 }}" />
@@ -46,6 +39,9 @@
{% block "footer" %}
<div id="footer">
{% block "validation_bar" %}
+ {% if wizard.form.SEARCH_AND_SELECT %}
+ <p class="confirm-message">{% trans "Search and select an item in the table" %}</p>
+ {% endif %}
{% include 'ishtar/wizard/validation_bar.html' %}
{% endblock %}
{% include 'ishtar/blocks/footer.html' %}
diff --git a/ishtar_common/templates/ishtar/wizard/parcels_wizard.html b/ishtar_common/templates/ishtar/wizard/parcels_wizard.html
index 28ec962f4..6a553d3c1 100644
--- a/ishtar_common/templates/ishtar/wizard/parcels_wizard.html
+++ b/ishtar_common/templates/ishtar/wizard/parcels_wizard.html
@@ -1,5 +1,5 @@
{% extends "ishtar/wizard/default_wizard.html" %}
-{% load i18n range inline_formset %}
+{% load i18n range inline_formset table_form %}
{% block extra_head %}
{{wizard.form.media}}
{% endblock %}
@@ -9,19 +9,30 @@
{{ wizard.form.media }}
{{ wizard.management_form }}
{{ wizard.form.management_form }}
-{% if automatic_parcel_association %}<p class='alert'><i class="fa fa-exclamation-triangle" aria-hidden="true"></i> <label>{%trans "Existing parcels from the operation will be automatically added to the archaeological file." %}</label></p>{% endif %}
- {%if wizard.form.non_form_errors%}
-<table class='formset'>
-<tr class='error'><th colspan='2'>{{wizard.form.non_form_errors}}</th></tr>
-</table>{%endif%}
-{{wizard.form.selection_form}}
+ {% if automatic_parcel_association %}
+ <div class="alert alert-danger" role="alert">
+ {%trans "Existing parcels from the operation will be automatically added to the archaeological file." %}
+ </div>
+ {% endif %}
+ {% if wizard.form.non_form_errors %}
+ <div class="alert alert-danger" role="alert">
+ {{wizard.form.non_form_errors}}
+ </div>{%endif%}
+
+ {% bs_form wizard.form.selection_form %}
+
<table class='inline-table' id='parcel-table'>
<tr>{% for field in wizard.form.forms.0 %}<th{% if not forloop.last %} rowspan='2'{% endif %}>{{ field.label_tag }}</th>{% endfor %}</tr>
<tr><td>({% trans "all"%} <input type='checkbox' name='check-all' class='check-all'/>)</td></tr>
{% inline_formset 'Parcels' wizard.form.forms False %}
</table>
{% if add_all %}<p><input type='checkbox' name='add_all_parcels' id='add_all_parcels'> <label for='add_all_parcels'>{% trans "Add all parcels from the archaeological file" %}</label></p>{% endif %}
-<p><button name="formset_modify" value="{{wizard.steps.current}}">{% trans "Add/Modify" %}</button></p>
+
+ <div class="text-center">
+ <button class="btn btn-success" name="formset_modify" value="{{wizard.steps.current}}">
+ {% trans "Add/Modify" %}
+ </button>
+ </div>
<input type="hidden" name="{{ step_field }}" value="{{ step0 }}" />
{{ previous_fields|safe }}
{% block "footer" %}
diff --git a/ishtar_common/templates/ishtar/wizard/search.html b/ishtar_common/templates/ishtar/wizard/search.html
index e5066cf87..e1f2433ea 100644
--- a/ishtar_common/templates/ishtar/wizard/search.html
+++ b/ishtar_common/templates/ishtar/wizard/search.html
@@ -4,10 +4,18 @@
{{wizard.form.media}}
{% endblock %}
{% block content %}
-<h2>{{wizard_label}}</h2>
-<ul id='form_path'>
- <li class='current'><a href='#'>{{current_step.form_label}}</a></li>
-</ul>
+<h3>{{wizard_label}}</h3>
+
+{% comment %}
+<nav aria-label="breadcrumb" role="navigation">
+ <ol class="breadcrumb">
+ <li class="breadcrumb-item active">
+ <a href='#'>{{current_step.form_label}}</a>
+ </li>
+ </ol>
+</nav>
+{% endcomment %}
+<form action="." class='wizard-form' id="wizard-form" method="post" name='wizard'>{% csrf_token %}
{% if wizard.form.forms %}
<div class='form'>
<div class='top_button'><input type="submit" id="submit_form" value="{% trans "Validate" %}"/></div>
@@ -20,8 +28,10 @@
<tr class='modify'><td colspan="2"><button name="formset_modify" value="{{wizard.steps.current}}">{% trans "Add/Modify" %}</button></td></tr></li>
</table>
{% else %}
-<div class='form'>
+<div class='form search'>
{{ wizard.form.as_p }}
</div>
+</div>
{% endif %}
+</form>
{% endblock %}
diff --git a/ishtar_common/templates/ishtar/wizard/validation_bar.html b/ishtar_common/templates/ishtar/wizard/validation_bar.html
index b99b9e689..0a30fb7e1 100644
--- a/ishtar_common/templates/ishtar/wizard/validation_bar.html
+++ b/ishtar_common/templates/ishtar/wizard/validation_bar.html
@@ -1,8 +1,24 @@
{% load i18n %}
-<div id='validation-bar'>
- <input type="submit" id="submit_form" name='validate' value="{% trans 'Validate' %}"/>
+<div id='validation-bar' class="row text-center">
+ <div class="col-sm">
+ <button type="submit" id="submit_form" name='validate'
+ value="validate" class="btn btn-success">
+ {% trans 'Validate' %}
+ </button>
+ </div>
{% if last_step_is_available and next_steps %}
- <input type="submit" id="submit_end_form" name='validate_and_end' value="{% trans 'Validate and end' %}"/>
+ <div class="col-sm">
+ <button type="submit" id="submit_end_form" name='validate_and_end'
+ value="validate_and_end" class="btn btn-success">
+ {% trans 'Validate and end' %}
+ </button>
+ </div>
{% endif %}
- <a href="{% url 'reset_wizards' %}" id="reset_wizards" class='button'>{% trans "Cancel" %}</a>
+ <div class="col-sm">
+ <a href="{% url 'reset_wizards' %}" id="reset_wizards">
+ <button type="button" class="btn btn-secondary">
+ {% trans "Cancel" %}
+ </button>
+ </a>
+ </div>
</div>
diff --git a/ishtar_common/templates/ishtar/wizard/wizard_done.html b/ishtar_common/templates/ishtar/wizard/wizard_done.html
index 2823c1bae..5acd6e78e 100644
--- a/ishtar_common/templates/ishtar/wizard/wizard_done.html
+++ b/ishtar_common/templates/ishtar/wizard/wizard_done.html
@@ -1,14 +1,24 @@
{% extends "base.html" %}
{% load i18n %}
+
+{% block top_content %}
+<div class="alert alert-success alert-dismissible fade show" role="alert">
+ {%trans "Item successfully saved"%}<button type="button" class="close" data-dismiss="alert" aria-label="Close">
+ <span aria-hidden="true">&times;</span>
+</button>
+</div>
+{% endblock %}
+
{% block content %}
-<p>{%trans "Item successfully saved"%}</p>
{% if redirect or wizard_done_window %}
<script type='text/javascript' language='javascript'>
{% if redirect %}
window.location.href = "{{redirect}}";
{% endif %}
{% if wizard_done_window %}
-$(function(){ load_window("{{wizard_done_window}}{{item.pk}}/"); });
+$(function(){
+ load_window("{{wizard_done_window}}{{item.pk}}/", "",
+ function (){}, true); });
{% endif %}
</script>
{% endif %}
diff --git a/ishtar_common/templates/ishtar/wizard/wizard_person.html b/ishtar_common/templates/ishtar/wizard/wizard_person.html
index e518ecc3d..fc15dbfad 100644
--- a/ishtar_common/templates/ishtar/wizard/wizard_person.html
+++ b/ishtar_common/templates/ishtar/wizard/wizard_person.html
@@ -1,59 +1,88 @@
{% extends "ishtar/wizard/default_wizard.html" %}
{% load i18n range table_form %}
{% block form_detail %}
+{% if form.non_field_errors %}
+<div class="alert alert-danger" role="alert">
+ {{form.non_field_errors}}
+</div>
+{% endif %}
-<table class='formset'>
- <caption>{% trans "Identity" %}</caption>
- {% table_field wizard.form.title %}
- {% table_field wizard.form.surname 1 %}
- {% table_field wizard.form.name 1 %}
- {% table_field wizard.form.raw_name %}
- {% table_field wizard.form.email %}
- {% table_field wizard.form.attached_to %}
-</table>
+{% for hidden in form.hidden_fields %}
+{{hidden}}
+{% if hidden.errors %}<div class="invalid-feedback">
+ {{ hidden.errors }}
+</div>{% endif %}
+{% endfor %}
-<hr class='spacer'/>
-<table class='formset table-form'>
- <caption>{% trans "Phone" %}</caption>
- <tr>
- <th>{% trans "Phone type" %}</th>
- <th>{% trans "Number" context "phone number" %}</th>
- </tr>
- <tr>
- <td>{{ wizard.form.phone_desc.errors }}{{wizard.form.phone_desc|safe}}</td>
- <td>{{ wizard.form.phone.errors }}{{wizard.form.phone|safe}}</td>
- </tr>
- <tr>
- <td>{{ wizard.form.phone_desc2.errors }}{{wizard.form.phone_desc2|safe}}</td>
- <td>{{ wizard.form.phone2.errors }}{{wizard.form.phone2|safe}}</td>
- </tr>
- <tr>
- <td>{{ wizard.form.phone_desc3.errors }}{{wizard.form.phone_desc3|safe}}</td>
- <td>{{ wizard.form.phone3.errors }}{{wizard.form.phone3|safe}}</td>
- </tr>
- <tr>
- <td>{% trans "Mobile phone" %}</td>
- <td>{{ wizard.form.mobile_phone.errors }}{{wizard.form.mobile_phone|safe}}</td>
- </tr>
-</table>
-<hr class='spacer'/>
+<div class="card">
+ <div class="card-header">
+ {% trans "Identity" %}
+ </div>
+ <div class="card-body form-row">
+ {% bs_field wizard.form.surname 1 %}
+ {% bs_field wizard.form.name 1 %}
+ {% bs_field wizard.form.title %}
+ {% bs_field wizard.form.raw_name %}
+ {% bs_field wizard.form.email %}
+ {% bs_field wizard.form.attached_to %}
+ </div>
+</div>
-<table class='formset'>
- <caption>{% trans "Business address" %}</caption>
- {% table_field wizard.form.address %}
- {% table_field wizard.form.address_complement %}
- {% table_field wizard.form.postal_code %}
- {% table_field wizard.form.town %}
- {% table_field wizard.form.country %}
-</table>
-<hr class='spacer'/>
-<table class='formset'>
- <caption>{% trans "Other address" %}</caption>
- {% table_field wizard.form.alt_address 0 'Address' %}
- {% table_field wizard.form.alt_address_complement 0 'Address complement' %}
- {% table_field wizard.form.alt_postal_code 0 'Postal code' %}
- {% table_field wizard.form.alt_town 0 'Town' %}
- {% table_field wizard.form.alt_country 0 'Country' %}
-</table>
+<div class="card">
+ <div class="card-header">
+ {% trans "Phone" %}
+ </div>
+ <div class="card-body form-row">
+ <table class='table table-striped'>
+ <tr>
+ <th>{% trans "Phone type" %}</th>
+ <th>{% trans "Number" context "phone number" %}</th>
+ </tr>
+ <tr>
+ <td>{{ wizard.form.phone_desc.errors }}{{wizard.form.phone_desc|safe}}</td>
+ <td>{{ wizard.form.phone.errors }}{{wizard.form.phone|safe}}</td>
+ </tr>
+ <tr>
+ <td>{{ wizard.form.phone_desc2.errors }}{{wizard.form.phone_desc2|safe}}</td>
+ <td>{{ wizard.form.phone2.errors }}{{wizard.form.phone2|safe}}</td>
+ </tr>
+ <tr>
+ <td>{{ wizard.form.phone_desc3.errors }}{{wizard.form.phone_desc3|safe}}</td>
+ <td>{{ wizard.form.phone3.errors }}{{wizard.form.phone3|safe}}</td>
+ </tr>
+ <tr>
+ <td>{% trans "Mobile phone" %}</td>
+ <td>{{ wizard.form.mobile_phone.errors }}{{wizard.form.mobile_phone|safe}}</td>
+ </tr>
+ </table>
+ </div>
+</div>
+
+
+<div class="card">
+ <div class="card-header">
+ {% trans "Business address" %}
+ </div>
+ <div class="card-body form-row">
+ {% bs_field wizard.form.address %}
+ {% bs_field wizard.form.address_complement %}
+ {% bs_field wizard.form.postal_code %}
+ {% bs_field wizard.form.town %}
+ {% bs_field wizard.form.country %}
+ </div>
+</div>
+
+<div class="card">
+ <div class="card-header">
+ {% trans "Other address" %}
+ </div>
+ <div class="card-body form-row">
+ {% bs_field wizard.form.alt_address 0 'Address' %}
+ {% bs_field wizard.form.alt_address_complement 0 'Address complement' %}
+ {% bs_field wizard.form.alt_postal_code 0 'Postal code' %}
+ {% bs_field wizard.form.alt_town 0 'Town' %}
+ {% bs_field wizard.form.alt_country 0 'Country' %}
+ </div>
+</div>
{% endblock %}