diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-03-06 10:58:00 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-03-06 11:18:41 +0100 |
commit | 7e88bd5c33805259ffc3aacaeeb825f5279e29e3 (patch) | |
tree | 9ff9db0c8b22c33f8d0d95db2154ab1fcaa2ab58 | |
parent | 6a3126fbde683b032d508145082b188cab6d8816 (diff) | |
download | Ishtar-7e88bd5c33805259ffc3aacaeeb825f5279e29e3.tar.bz2 Ishtar-7e88bd5c33805259ffc3aacaeeb825f5279e29e3.zip |
"Validate and end" button is not displayed if the end panel is not available (refs #3353)
-rw-r--r-- | ishtar_common/templates/ishtar/wizard/validation_bar.html | 8 | ||||
-rw-r--r-- | ishtar_common/wizards.py | 5 |
2 files changed, 9 insertions, 4 deletions
diff --git a/ishtar_common/templates/ishtar/wizard/validation_bar.html b/ishtar_common/templates/ishtar/wizard/validation_bar.html index 09907af67..a1590858f 100644 --- a/ishtar_common/templates/ishtar/wizard/validation_bar.html +++ b/ishtar_common/templates/ishtar/wizard/validation_bar.html @@ -1,7 +1,9 @@ {% load i18n %} {% load url from future %} <div id='validation-bar'> - <input type="submit" id="submit_form" name='validate' value="{% trans "Validate" %}"/> - {% if next_steps %}<input type="submit" id="submit_end_form" name='validate_and_end' value="{% trans "Validate and end" %}"/>{% endif %} - <a href='{% url 'reset_wizards' %}' id="reset_wizards" class='button'>{% trans "Cancel" %}</a> + <input type="submit" id="submit_form" name='validate' value="{% trans 'Validate' %}"/> + {% if last_step_is_available and next_steps %} + <input type="submit" id="submit_end_form" name='validate_and_end' value="{% trans 'Validate and end' %}"/> + {% endif %} + <a href="{% url 'reset_wizards' %}" id="reset_wizards" class='button'>{% trans "Cancel" %}</a> </div> diff --git a/ishtar_common/wizards.py b/ishtar_common/wizards.py index 210ea749a..874b68eae 100644 --- a/ishtar_common/wizards.py +++ b/ishtar_common/wizards.py @@ -243,6 +243,7 @@ class Wizard(NamedUrlWizardView): current_step_passed, no_next = False, False # force rechecking of conditions self.get_form_list() + last_step_is_available = True while next_step: # check if the form is initialized otherwise initialize it if self.modification and not storage.get_step_data(next_step): @@ -297,8 +298,10 @@ class Wizard(NamedUrlWizardView): next_step = self.get_next_step(next_step) if no_next: + last_step_is_available = False break - context.update({'next_steps': next_steps}) + context.update({'next_steps': next_steps, + 'last_step_is_available': last_step_is_available}) # not last step: validation if current_step != self.steps.last: return context |