diff options
Diffstat (limited to 'ishtar_common/templates')
| -rw-r--r-- | ishtar_common/templates/ishtar/wizard/default_wizard.html | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/ishtar_common/templates/ishtar/wizard/default_wizard.html b/ishtar_common/templates/ishtar/wizard/default_wizard.html index 28b9850d7..6b4bce709 100644 --- a/ishtar_common/templates/ishtar/wizard/default_wizard.html +++ b/ishtar_common/templates/ishtar/wizard/default_wizard.html @@ -9,11 +9,11 @@ <form action="." method="post" name='wizard'{% if wizard.form.file_upload %} enctype="multipart/form-data"{% endif %}>{% csrf_token %} <ul id='form_path'> {% for step in previous_steps %} - <li>» <button name="form_prev_step" value="{{forloop.counter0}}">{{step.form_label}}</button></li> + <li>» <button class='change_step' name="form_prev_step" value="{{forloop.counter0}}">{{step.form_label}}</button></li> {% endfor %} <li class='current'>» <a href='#'>{{current_step.form_label}}</a></li> {% for step in next_steps %} - <li>» <button name="form_prev_step" value="{{forloop.counter|add:previous_step_counter}}">{{step.form_label}}</button></li> + <li>» <button class='change_step' name="form_prev_step" value="{{forloop.counter|add:previous_step_counter}}">{{step.form_label}}</button></li> {% endfor %} </ul> {% endblock %} @@ -44,4 +44,18 @@ </div> </form> {% endblock %} +<script language="javascript" type="text/javascript"> +var form_changed = false; +$(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; + }); + +}); +</script> {% endblock %} |
