Merge pull request #1145 from dod-ccpo/bugfix/disallow-resent-invite-with-invalid-date
Allow submit buttons to be valid on initial render
This commit is contained in:
commit
06239c94ba
@ -62,7 +62,7 @@
|
|||||||
{{ member.update_invite_form.csrf_token }}
|
{{ member.update_invite_form.csrf_token }}
|
||||||
{{ member_fields.InfoFields(member.update_invite_form) }}
|
{{ member_fields.InfoFields(member.update_invite_form) }}
|
||||||
<div class="action-group">
|
<div class="action-group">
|
||||||
<input type="submit" class="usa-button usa-button-primary action-group__action" tabindex="0" value="Resend Invite" />
|
{{ SaveButton(text="Resend Invite", disable_on_initial_render=False)}}
|
||||||
<a class='action-group__action' v-on:click="closeModal('{{ resend_invite_modal }}')">{{ "common.cancel" | translate }}</a>
|
<a class='action-group__action' v-on:click="closeModal('{{ resend_invite_modal }}')">{{ "common.cancel" | translate }}</a>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
{% macro SaveButton(text, element="button", additional_classes="", form=None) -%}
|
{% macro SaveButton(text, 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"%}
|
||||||
|
|
||||||
{% if element == "button" %}
|
{% if element == "button" %}
|
||||||
<button type="submit" class="{{ class }}" tabindex="0" v-bind:disabled="!changed || invalid" {{ 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="!changed || invalid" value="{{ text }}" {% if form %}form="{{ form }}"{% endif %} />
|
<input type="submit" class="{{ class }}" tabindex="0" v-bind:disabled="invalid" value='{{ disabled }}' {% if form %}form="{{ form }}"{% endif %} />
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{%- endmacro %}
|
{%- endmacro %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user