Update SaveButton to be either an input or a button element, and restore inputs that were previously switched to buttons

This commit is contained in:
leigh-mil 2019-04-04 13:29:15 -04:00
parent 850153a517
commit f3ea704c1b
5 changed files with 10 additions and 8 deletions

View File

@ -1,6 +1,8 @@
{% macro SaveButton(text, additional_classes="") -%}
{% macro SaveButton(text, element="button", additional_classes="", other_attrs="") -%}
{% set class = "usa-button usa-button-primary" + additional_classes %}
<button type="submit" class="{{ class }}" tabindex="0" v-bind:disabled="!changed">
{{ text }}
</button>
<{{ element }} type="submit" class="{{ class }}" tabindex="0" v-bind:disabled="!changed" value="{{ text }}" {{ other_attrs }}>
{% if element == 'button'%}
{{ text }}
{% endif %}
</{{ element }}>
{%- endmacro %}

View File

@ -60,7 +60,7 @@
{{ Icon("x") }}
<span>Cancel</span>
</a>
{{ SaveButton(text='Save Changes') }}
{{ SaveButton(text='Save Changes', element="input") }}
</div>
</div>
</template>

View File

@ -103,7 +103,7 @@
{% endblock %}
<div class='action-group'>
{{ SaveButton(text="Continue") }}
{{ SaveButton(text="Continue", element="input") }}
</div>
</form>

View File

@ -32,7 +32,7 @@
{{ MultiCheckboxInput(form.required_distribution) }}
<div class="action-group">
{{ SaveButton(text='Continue') }}
{{ SaveButton(text='Continue', additional_classes="usa-button-big") }}
</div>
</form>
</div>

View File

@ -39,7 +39,7 @@
</div>
</div>
<div class="action-group">
{{ SaveButton(text=('common.sign' | translate)) }}
{{ SaveButton(text=('common.sign' | translate), additional_classes="usa-button-big") }}
<a
href="{{ url_for("portfolios.ko_review", portfolio_id=portfolio_id, task_order_id=task_order_id) }}"
class="action-group__action icon-link">