Style improvements to the add a new application page:

- fix size of description textarea
- place "remove" buttons closer to text input fields for environments
- add icon for "add another environment" link
This commit is contained in:
dandds 2019-05-02 07:04:23 -04:00
parent bcde637553
commit e457e9a60d
4 changed files with 40 additions and 17 deletions

View File

@ -5,6 +5,10 @@
.usa-input { .usa-input {
margin: 0 ($gap * 4) 0 0; margin: 0 ($gap * 4) 0 0;
flex-grow: 2;
}
.application-edit__env-list-item-block {
flex-grow: 1; flex-grow: 1;
} }

View File

@ -1,8 +0,0 @@
{% from "components/text_input.html" import TextInput %}
{{ form.csrf_token }}
<p>
{{ "fragments.edit_application_form.explain" | translate }}
</p>
{{ TextInput(form.name) }}
{{ TextInput(form.description, paragraph=True) }}

View File

@ -37,7 +37,26 @@
</div> </div>
{% endcall %} {% endcall %}
{% include "fragments/applications/edit_application_form.html" %} {{ form.csrf_token }}
<p>
{{ "fragments.edit_application_form.explain" | translate }}
</p>
<div class="form-row">
<div class="form-col form-col--two-thirds">
{{ TextInput(form.name) }}
</div>
<div class="form-col form-col--third">
&nbsp;
</div>
</div>
<div class="form-row">
<div class="form-col form-col--two-thirds">
{{ TextInput(form.description, paragraph=True) }}
</div>
<div class="form-col form-col--third">
&nbsp;
</div>
</div>
<div> {# this extra div prevents this bug: https://www.pivotaltracker.com/story/show/160768940 #} <div> {# this extra div prevents this bug: https://www.pivotaltracker.com/story/show/160768940 #}
<div v-cloak v-for="title in errors" :key="title"> <div v-cloak v-for="title in errors" :key="title">
@ -57,22 +76,29 @@
<li v-for="(environment, i) in environments" class="application-edit__env-list-item"> <li v-for="(environment, i) in environments" class="application-edit__env-list-item">
<div class="usa-input"> <div class="usa-input">
<label :for="'environment_names-' + i">Environment Name</label> <label :for="'environment_names-' + i">Environment Name</label>
<input type="text" :id="'environment_names-' + i" v-model="environment.name" placeholder="e.g. Development, Staging, Production"/> <input type="text" :id="'environment_names-' + i" v-model="environment.name" placeholder="e.g. Development, Staging, Production"/> <input type="hidden" :name="'environment_names-' + i" v-model="environment.name"/>
<input type="hidden" :name="'environment_names-' + i" v-model="environment.name"/>
</div> </div>
<button v-on:click="removeEnvironment(i)" v-if="environments.length > 1" type="button" class='application-edit__env-list-item__remover'> <div class="application-edit__env-list-item-block">
<button v-on:click="removeEnvironment(i)" v-if="environments.length > 1" type="button" class="application-edit__env-list-item__remover">
{{ Icon('trash') }} {{ Icon('trash') }}
<span>Remove</span> <span>Remove</span>
</button> </button>
</div>
</li> </li>
</ul> </ul>
<div class="block-list__footer"> <div class="block-list__footer">
<button v-on:click="addEnvironment" class="icon-link" tabindex="0" type="button">Add another environment</button> <button
v-on:click="addEnvironment"
class="icon-link"
tabindex="0"
type="button">
{{ 'portfolios.applications.add_another_environment' | translate }}
{{ Icon("plus") }}
</button>
</div> </div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -400,6 +400,7 @@ portfolios:
applications: applications:
add_application_text: Add a new application add_application_text: Add a new application
add_environment: Add new environment add_environment: Add new environment
add_another_environment: Add another environment
app_settings_text: App settings app_settings_text: App settings
create_button_text: Create create_button_text: Create
csp_console_text: CSP console csp_console_text: CSP console