Update form subtemplate button

Will show "Submit" for forms without an instance
and "Save" for forms with an instance. Should be better
than the older behavior of just testing for a template
object.

Signed-off-by: Roberto Rosario <roberto.rosario@mayan-edms.com>
This commit is contained in:
Roberto Rosario
2019-11-10 03:34:07 -04:00
parent bfd4db5d35
commit cf154c46f4

View File

@@ -10,11 +10,10 @@
<div class="well">
{% if form.is_multipart %}
<form action="{{ form_action }}" class="{{ form_css_classes|default:'' }}" enctype="multipart/form-data" method="{{ submit_method|default:'post' }}" name="{{ form.prefix }}" target="{{ submit_target|default:'_self' }}">
<form action="{{ form_action }}" class="{{ form_css_classes|default:'' }}" enctype="multipart/form-data" method="{{ submit_method|default:'post' }}" name="{{ form.prefix|default:'' }}" target="{{ submit_target|default:'_self' }}">
{% else %}
<form action="{{ form_action }}" class="{{ form_css_classes|default:'' }}" method="{{ submit_method|default:'post' }}" name="{{ form.prefix }}" target="{{ submit_target|default:'_self' }}">
<form action="{{ form_action }}" class="{{ form_css_classes|default:'' }}" method="{{ submit_method|default:'post' }}" name="{{ form.prefix|default:'' }}" target="{{ submit_target|default:'_self' }}">
{% endif %}
{{ wizard.management_form }}
{% if step_field %}
@@ -83,7 +82,7 @@
{% else %}
<i class="fa fa-check"></i>
{% endif %}
{% if submit_label %}{{ submit_label }}{% else %}{% if object %}{% trans 'Save' %}{% else %}{% trans 'Submit' %}{% endif %}{% endif %}
{% if submit_label %}{{ submit_label }}{% else %}{% if form.instance %}{% trans 'Save' %}{% else %}{% trans 'Submit' %}{% endif %}{% endif %}
</button>
{% if previous %}
&nbsp;<a class="btn btn-default" onclick='history.back();'>