Only show environment fields in form when a new project is created

This commit is contained in:
leigh-mil 2018-10-15 14:03:13 -04:00
parent 25b84a4df6
commit b9a2d667f6

View File

@ -48,31 +48,33 @@
</div>
</div>
<div class="block-list project-list-item">
<header class="block-list__header block-list__header--grow">
<h2 class="block-list__title">Project Environments</h2>
<p>
Each environment created within a project is an enclave of cloud resources that is logically separated from each other for increased security.
</p>
</header>
{% if new_project %}
<div class="block-list project-list-item">
<header class="block-list__header block-list__header--grow">
<h2 class="block-list__title">Project Environments</h2>
<p>
Each environment created within a project is an enclave of cloud resources that is logically separated from each other for increased security.
</p>
</header>
<ul>
<li v-for="(environment, i) in environments" class="block-list__item project-edit__env-list-item">
<div class="usa-input">
<label :for="'environment_names-' + i">Environment Name</label>
<input type="text" :name="'environment_names-' + i" :id="'environment_names-' + i" v-model="environment.name" placeholder="e.g. Development, Staging, Production">
</div>
<button v-on:click="removeEnvironment(i)" v-if="environments.length > 1" type="button" class='project-edit__env-list-item__remover'>
{{ Icon('trash') }}
<span>Remove</span>
</button>
</li>
</ul>
<ul>
<li v-for="(environment, i) in environments" class="block-list__item project-edit__env-list-item">
<div class="usa-input">
<label :for="'environment_names-' + i">Environment Name</label>
<input type="text" :name="'environment_names-' + i" :id="'environment_names-' + i" v-model="environment.name" placeholder="e.g. Development, Staging, Production">
</div>
<button v-on:click="removeEnvironment(i)" v-if="environments.length > 1" type="button" class='project-edit__env-list-item__remover'>
{{ Icon('trash') }}
<span>Remove</span>
</button>
</li>
</ul>
<div class="block-list__footer">
<button v-on:click="addEnvironment" class="icon-link" tabindex="0" type="button">Add another environment</button>
<div class="block-list__footer">
<button v-on:click="addEnvironment" class="icon-link" tabindex="0" type="button">Add another environment</button>
</div>
</div>
</div>
{% endif %}
<div class="action-group">
<button class="usa-button usa-button-primary" tabindex="0" type="submit">{{ action_text }} Project</button>