use 'text=' in the SaveButton kwargs and add in a default for the save button text
This commit is contained in:
parent
06239c94ba
commit
f3dcca8368
@ -22,7 +22,7 @@
|
|||||||
{{ TextInput(application_form.name, optional=False) }}
|
{{ TextInput(application_form.name, optional=False) }}
|
||||||
{{ TextInput(application_form.description, paragraph=True, optional=True, showOptional=False) }}
|
{{ TextInput(application_form.description, paragraph=True, optional=True, showOptional=False) }}
|
||||||
<div class="action-group action-group--tight">
|
<div class="action-group action-group--tight">
|
||||||
{{ SaveButton('common.save_changes'|translate) }}
|
{{ SaveButton(text='common.save_changes'|translate) }}
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</base-form>
|
</base-form>
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
{% macro SaveButton(text, element="button", additional_classes="", form=None, disable_on_initial_render=True) -%}
|
{% macro SaveButton(text="common.save" | translate, element="button", additional_classes="", form=None, disable_on_initial_render=True) -%}
|
||||||
{% set class = "usa-button usa-button-primary" + additional_classes %}
|
{% set class = "usa-button usa-button-primary" + additional_classes %}
|
||||||
{% set disabled = "!changed || invalid" if disable_on_initial_render else "invalid"%}
|
{% set disabled = "!changed || invalid" if disable_on_initial_render else "invalid"%}
|
||||||
|
|
||||||
{% if element == "button" %}
|
{% if element == "button" %}
|
||||||
<button type="submit" class="{{ class }}" tabindex="0" v-bind:disabled='{{ disabled }}' {{ form_attr }} >
|
<button type="submit" class="{{ class }}" tabindex="0" v-bind:disabled='{{ disabled }}' {{ form_attr }} >
|
||||||
{{ text }}
|
{{ text }}
|
||||||
</button>
|
</button>
|
||||||
{% elif element == 'input' %}
|
{% elif element == 'input' %}
|
||||||
<input type="submit" class="{{ class }}" tabindex="0" v-bind:disabled="invalid" value='{{ disabled }}' {% if form %}form="{{ form }}"{% endif %} />
|
<input type="submit" class="{{ class }}" tabindex="0" v-bind:disabled='{{ disabled }}' value='{{ text }}' {% if form %}form="{{ form }}"{% endif %} />
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{%- endmacro %}
|
{%- endmacro %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user