Hide Cancel button if no cancel_url is provided

If there is no cancel_url is defined on the ModalFormView
class, hide the Cancel button.

Change-Id: Id27c60525560dcfdb5cfafa2c4cd7b4edffea158
Closes-Bug: #1434548
This commit is contained in:
lin-hua-cheng 2015-04-20 20:49:31 -07:00
parent 3ef270b940
commit 0e116f2a0b
1 changed files with 2 additions and 0 deletions

View File

@ -40,10 +40,12 @@
</div>
<div class="modal-footer">
{% block modal-footer %}
{% if cancel_url %}
<a href="{% block cancel_url %}{{ cancel_url }}{% endblock %}"
class="btn btn-default cancel">
{{ cancel_label }}
</a>
{% endif %}
<input class="btn btn-primary" type="submit" value="{{ submit_label }}">
{% endblock %}
</div>