summaryrefslogtreecommitdiff
path: root/ishtar_common/templates/ishtar/wizard/default_wizard.html
blob: 249d4c4ce9c949afd4f87f61e06efc37f8eee643 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
{% extends "base.html" %}
{% load i18n range table_form %}
{% block extra_head %}
{{wizard.form.media}}
{% endblock %}
{% block content %}
{% block wizard_head %}
<h3>{{wizard_label}}</h3>

{% include "ishtar/blocks/wizard_breadcrumb.html" %}

{% endblock %}
{% block wizard_form %}
<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{% if not form.SEARCH_AND_SELECT %} container{% endif %}'>
{{ wizard.management_form }}
{% block form_head %}{% endblock %}
{% block form_detail %}
{% if wizard.form.forms %}
  {{ wizard.form.management_form }}
  {% 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 %}
  {% bs_form formsetform forloop.counter0 %}
  {% endfor %}
    <button class="btn btn-success" name="formset_modify" value="{{wizard.steps.current}}">
      {% trans "Add/Modify" %}
    </button>
{% else %}
  {% bs_form wizard.form %}
{% endif %}
{% endblock %}
<input type="hidden" name="{{ step_field }}" value="{{ step0 }}" />
{{ previous_fields|safe }}
{% 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' %}
  </div>
{% endblock %}
</div>
</form>
{% endblock %}
<script language="javascript" type="text/javascript">
var form_changed = false;
{% block "js_extra_generic" %}
{% endblock %}
$(document).ready(function(){
    $('form :input').change(function(){form_changed=true;});
    $('.change_step').click(function(){
        if(!form_changed ||
           confirm("{% trans "The form has changed. If you don't validate it, all your changes will be lost." %}")){
            return true;
        }
        return false;
    });
    {% if open_url %}load_window("{{open_url}}");{% endif %}
    {% block "js_extra_ready" %}
    {% endblock %}
});
</script>
{% endblock %}