atst/templates/applications/fragments/add_new_environment.html
graham-dds 3cf9fdac76 Add frontend validation for TextInput()s
- Add input validation regexes to input_validations.js
- Add those validators to text fields without validaiton
2020-01-22 15:20:18 -05:00

31 lines
1.4 KiB
HTML

{% from "components/alert.html" import Alert %}
{% from 'components/save_button.html' import SaveButton %}
{% from "components/text_input.html" import TextInput %}
<new-environment inline-template>
<div>
<div v-if="open">
<form method='POST' id="add-new-env" action='{{ url_for("applications.new_environment", application_id=application.id) }}' autocomplete="off" enctype="multipart/form-data">
{{ new_env_form.csrf_token }}
{{ Alert(
title=("portfolios.applications.create_new_env" | translate),
message=("portfolios.applications.create_new_env_info" | translate )
) }}
<div class="accordion-table__item-content new-env">
<div class="h4">{{ "portfolios.applications.enter_env_name" | translate }}</div>
{{ TextInput(new_env_form.name, label="", validation="defaultStringField", optional=False) }}
<div class="action-group">
{{ SaveButton(text=('common.save' | translate), element="input", form="add-new-env") }}
<a class='action-group__action icon-link icon-link--default' v-on:click="toggle">
{{ "common.cancel" | translate }}
</a>
</div>
</div>
</form>
</div>
<a class="usa-button usa-button-secondary add-new-button" v-on:click="toggle">
{{ "portfolios.applications.add_environment" | translate }}
</a>
</div>
</new-environment>