Don't use the previous variable when canceling a form action. Form now use only javascript's history.back().

Signed-off-by: Eric Riggs <ericriggs42@gmail.com>
This commit is contained in:
Eric Riggs
2018-03-07 02:11:46 -04:00
committed by Roberto Rosario
parent d83a50d36a
commit fc8dc74de4
3 changed files with 3 additions and 3 deletions

View File

@@ -49,7 +49,7 @@
</button>
{% if previous %}
<a class="btn btn-primary" onclick='{% if previous %}window.location.replace("{{ previous }}");{% else %}history.back();{% endif %}'>{% trans 'No' %}</a>
<a class="btn btn-primary" onclick='history.back();'>{% trans 'No' %}</a>
{% endif %}
</form>

View File

@@ -75,7 +75,7 @@
<div class="form-group">
<button class="btn btn-primary" name="{% if form.prefix %}{{ form.prefix }}-submit{% else %}submit{% endif %}" type="submit"><i class="{{ submit_icon|default:'fa fa-check' }}"></i> {% if submit_label %}{{ submit_label }}{% else %}{% if object %}{% trans 'Save' %}{% else %}{% trans 'Submit' %}{% endif %}{% endif %}</button>
{% if previous %}
&nbsp;<a class="btn btn-default" onclick='{% if previous %}window.location.replace("{{ previous }}");{% else %}history.back();{% endif %}'>
&nbsp;<a class="btn btn-default" onclick='history.back();'>
<i class="fa fa-times"></i> {% if cancel_label %}{{ cancel_label }}{% else %}{% trans 'Cancel' %}{% endif %}
</a>
{% endif %}

View File

@@ -63,7 +63,7 @@
<button class="btn btn-primary" name="{% if form.prefix %}{{ form.prefix }}-submit{% else %}submit{% endif %}" type="submit"><i class="{{ submit_icon|default:'fa fa-check' }}"></i> {% if submit_label %}{{ submit_label }}{% else %}{% if object %}{% trans 'Save' %}{% else %}{% trans 'Submit' %}{% endif %}{% endif %}</button>
{% endif %}
{% if previous %}
&nbsp;<a class="btn btn-default" onclick='{% if previous %}window.location.replace("{{ previous }}");{% else %}history.back();{% endif %}'>
&nbsp;<a class="btn btn-default" onclick='history.back();'>
<i class="fa fa-cross"></i> {% if cancel_label %}{{ cancel_label }}{% else %}{% trans 'Cancel' %}{% endif %}
</a>
{% endif %}