Update copy, add totals box, style buttons

This commit is contained in:
leigh-mil 2019-06-10 16:44:09 -04:00
parent bad99edd4c
commit 1e817c6755
6 changed files with 294 additions and 251 deletions

View File

@ -19,8 +19,8 @@ from atst.utils.localization import translate
class CLINForm(FlaskForm): class CLINForm(FlaskForm):
jedi_clin_type = SelectField("Jedi CLIN type", choices=JEDI_CLIN_TYPES) jedi_clin_type = SelectField("CLIN type", choices=JEDI_CLIN_TYPES)
number = StringField(validators=[Required()]) number = StringField(label="CLIN", validators=[Required()])
start_date = DateField( start_date = DateField(
translate("forms.task_order.start_date_label"), translate("forms.task_order.start_date_label"),
format="%m/%d/%Y", format="%m/%d/%Y",
@ -31,7 +31,7 @@ class CLINForm(FlaskForm):
format="%m/%d/%Y", format="%m/%d/%Y",
validators=[Required()], validators=[Required()],
) )
obligated_amount = DecimalField() obligated_amount = DecimalField(label="Funds obligated for cloud")
loas = FieldList(StringField()) loas = FieldList(StringField())
@ -42,8 +42,7 @@ class UnclassifiedCLINForm(CLINForm):
class TaskOrderForm(BaseForm): class TaskOrderForm(BaseForm):
number = StringField( number = StringField(
translate("forms.task_order.number_label"), label=translate("forms.task_order.number_description"),
description=translate("forms.task_order.number_description"),
validators=[Required()], validators=[Required()],
) )
pdf = FileField( pdf = FileField(

View File

@ -2,6 +2,7 @@ import ClinFields from '../clin_fields'
import DateSelector from '../date_selector' import DateSelector from '../date_selector'
import FormMixin from '../../mixins/form' import FormMixin from '../../mixins/form'
import optionsinput from '../options_input' import optionsinput from '../options_input'
import SemiCollapsibleText from '../semi_collapsible_text'
import textinput from '../text_input' import textinput from '../text_input'
import uploadinput from '../upload_input' import uploadinput from '../upload_input'
@ -14,6 +15,7 @@ export default {
ClinFields, ClinFields,
DateSelector, DateSelector,
optionsinput, optionsinput,
SemiCollapsibleText,
textinput, textinput,
uploadinput, uploadinput,
}, },

View File

@ -14,7 +14,8 @@
initial_value='', initial_value='',
classes='', classes='',
noMaxWidth=False, noMaxWidth=False,
optional=False) -%} optional=False,
showLabel=True) -%}
<textinput <textinput
v-cloak v-cloak
@ -32,6 +33,7 @@
class='{% if disabled %}input--disabled{% endif %} {{ classes }}' class='{% if disabled %}input--disabled{% endif %} {{ classes }}'
v-bind:class="['usa-input usa-input--validation--' + validation, { 'usa-input--error': showError, 'usa-input--success': showValid, 'usa-input--validation--paragraph': paragraph, 'no-max-width': noMaxWidth }]"> v-bind:class="['usa-input usa-input--validation--' + validation, { 'usa-input--error': showError, 'usa-input--success': showValid, 'usa-input--validation--paragraph': paragraph, 'no-max-width': noMaxWidth }]">
{% if showLabel %}
<label for={{field.name}}> <label for={{field.name}}>
<div class="usa-input__title"> <div class="usa-input__title">
{{ label }} {{ label }}
@ -50,6 +52,7 @@
{% endif %} {% endif %}
</label> </label>
{% endif %}
{% if paragraph %} {% if paragraph %}

View File

@ -1,14 +1,19 @@
{% macro TotalsBox(task_order) -%} {% macro TotalsBox(task_order=None, obligated_funds=0, contract_amount=0) -%}
<div class="col totals-box"> <div class="col totals-box">
{% if task_order %}
{% set obligated_funds = task_order.total_obligated_funds %}
{% set contract_amount = task_order.total_contract_amount %}
{% endif %}
<div class="h4">Total obligated funds</div> <div class="h4">Total obligated funds</div>
<div class="h3">{{ task_order.total_obligated_funds | dollars }}</div> <div class="h3">{{ obligated_funds | dollars }}</div>
<div>This is the funding allocated to cloud services. It may be 100% or a portion of the total task order budget.</div> <div>This is the funding allocated to cloud services. It may be 100% or a portion of the total task order budget.</div>
<hr> <hr>
<div class="h4">Total contract amount</div> <div class="h4">Total contract amount</div>
<div class="h3">{{ task_order.total_contract_amount | dollars }}</div> <div class="h3">{{ contract_amount | dollars }}</div>
<div>This is the value of all funds obligated for this contract, including -- but not limited to -- funds obligated for the cloud.</div> <div>This is the value of all funds obligated for this contract, including -- but not limited to -- funds obligated for the cloud.</div>
</div> </div>

View File

@ -6,17 +6,13 @@
{% from 'components/save_button.html' import SaveButton %} {% from 'components/save_button.html' import SaveButton %}
{% from "components/sticky_cta.html" import StickyCTA %} {% from "components/sticky_cta.html" import StickyCTA %}
{% from 'components/text_input.html' import TextInput %} {% from 'components/text_input.html' import TextInput %}
{% from "components/totals_box.html" import TotalsBox %}
{% from 'components/upload_input.html' import UploadInput %} {% from 'components/upload_input.html' import UploadInput %}
{% macro LOAInput() %} {% macro LOAInput() %}
<div v-for="loa in loas"> <div v-for="loa in loas">
<textinput :name="'clins-' + clinIndex + '-loas-' + loaIndex(loa)" inline-template> <textinput :name="'clins-' + clinIndex + '-loas-' + loaIndex(loa)" inline-template>
<div> <div>
<label :for="name">
<span v-show='showError'>{{ Icon('alert',classes="icon-validation") }}</span>
<span v-show='showValid'>{{ Icon('ok',classes="icon-validation") }}</span>
<div class="usa-input__title">Line of Accounting</div>
</label>
<masked-input <masked-input
v-on:input='onInput' v-on:input='onInput'
@ -44,23 +40,32 @@
</textinput> </textinput>
</div> </div>
<button v-on:click="addLoa" type="button"> <button
Add another line of accounting class="icon-link"
v-on:click="addLoa"
type="button">
{{ Icon('plus') }}
<span>Add another line of accounting</span>
</button> </button>
{% endmacro %} {% endmacro %}
{% macro CLINFields(fields, index) %} {% macro CLINFields(fields, index) %}
{% if index != 0 %}
<hr>
{% endif %}
<clin-fields <clin-fields
v-bind:initial-clin-index='{{ index }}' v-bind:initial-clin-index='{{ index }}'
v-bind:initial-loa-count="{{ fields.loas.data | length }}" v-bind:initial-loa-count="{{ fields.loas.data | length }}"
inline-template> inline-template>
<div> <div>
<hr>
{{ OptionsInput(fields.jedi_clin_type) }} {{ OptionsInput(fields.jedi_clin_type) }}
{{ TextInput(fields.number) }} {{ TextInput(fields.number) }}
<div>Line of accounting (43 characters)</div>
{% for loa in fields.loas %} {% for loa in fields.loas %}
{{ TextInput(loa) }} {{ TextInput(loa, showLabel=False) }}
{% endfor %} {% endfor %}
{{ LOAInput() }} {{ LOAInput() }}
@ -84,9 +89,9 @@
</a> </a>
</span> </span>
{% endcall %} {% endcall %}
<div class="col task-order-form">
{% include "fragments/flash.html" %}
<to-form inline-template v-bind:initial-clin-count="{{ form.clins.data | length }}"> <to-form inline-template v-bind:initial-clin-count="{{ form.clins.data | length }}">
<div class="task-order-summary">
{% include "fragments/flash.html" %}
{% if task_order_id %} {% if task_order_id %}
{% set action = url_for("task_orders.update", portfolio_id=portfolio.id, task_order_id=task_order_id) %} {% set action = url_for("task_orders.update", portfolio_id=portfolio.id, task_order_id=task_order_id) %}
{% else %} {% else %}
@ -95,23 +100,39 @@
<form id="new-task-order" action='{{ action }}' method="POST" autocomplete="off" enctype="multipart/form-data"> <form id="new-task-order" action='{{ action }}' method="POST" autocomplete="off" enctype="multipart/form-data">
{{ form.csrf_token }} {{ form.csrf_token }}
<semi-collapsible-text inline-template>
<p> <div>
<div v-bind:class="{ 'semi-collapsed' : !open }">
{{ "task_orders.new.form_help_text" | translate }} {{ "task_orders.new.form_help_text" | translate }}
</p> </div>
<a v-on:click='toggle' v-show="!open" class="right more">More{{ Icon('caret_down') }}</a>
<a v-on:click='toggle' v-show="open" class="right more">Less{{ Icon('caret_up') }}</a>
</div>
</semi-collapsible-text>
<hr> <hr>
<div class="h1">Add your task order</div>
{{ TextInput(form.number, validation='taskOrderNumber') }} {{ TextInput(form.number, validation='taskOrderNumber') }}
<div class="h3">Add the summary of cloud funding</div>
<div>
Data must match with what is in your uploaded document.
</div>
{% for clin in form.clins %} {% for clin in form.clins %}
{{ CLINFields(clin, index=loop.index - 1) }} {{ CLINFields(clin, index=loop.index - 1) }}
{% endfor %} {% endfor %}
<div v-for="clin in clins"> <div v-for="clin in clins">
<hr> <hr v-if="clinIndex !== 0">
<clin-fields v-bind:initial-clin-index='clinIndex' inline-template> <clin-fields v-bind:initial-clin-index='clinIndex' inline-template>
<div> <div>
<div class="usa-input"> <div class="usa-input">
<fieldset data-ally-disabled="true" class="usa-input__choices"> <fieldset data-ally-disabled="true" class="usa-input__choices">
<legend> <legend>
<div class="usa-input__title"> <div class="usa-input__title">
CLIN type
</div> </div>
</legend> </legend>
<select :id="'clins-' + clinIndex + '-jedi_clin_type'" :name="'clins-' + clinIndex + '-jedi_clin_type'"> <select :id="'clins-' + clinIndex + '-jedi_clin_type'" :name="'clins-' + clinIndex + '-jedi_clin_type'">
@ -128,7 +149,7 @@
<label :for="name"> <label :for="name">
<span v-show='showError'>{{ Icon('alert',classes="icon-validation") }}</span> <span v-show='showError'>{{ Icon('alert',classes="icon-validation") }}</span>
<span v-show='showValid'>{{ Icon('ok',classes="icon-validation") }}</span> <span v-show='showValid'>{{ Icon('ok',classes="icon-validation") }}</span>
<div class="usa-input__title"> Number </div> <div class="usa-input__title">CLIN</div>
</label> </label>
<masked-input <masked-input
@ -156,6 +177,7 @@
</div> </div>
</textinput> </textinput>
<div>Line of accounting (43 characters)</div>
{{ LOAInput() }} {{ LOAInput() }}
<date-selector :name-tag="'clins-' + clinIndex + '-start_date'" inline-template> <date-selector :name-tag="'clins-' + clinIndex + '-start_date'" inline-template>
@ -273,7 +295,7 @@
<label :for="name"> <label :for="name">
<span v-show='showError'>{{ Icon('alert',classes="icon-validation") }}</span> <span v-show='showError'>{{ Icon('alert',classes="icon-validation") }}</span>
<span v-show='showValid'>{{ Icon('ok',classes="icon-validation") }}</span> <span v-show='showValid'>{{ Icon('ok',classes="icon-validation") }}</span>
<div class="usa-input__title">Obligated Amount</div> <div class="usa-input__title">Funds obligated for cloud</div>
</label> </label>
<masked-input <masked-input
@ -301,16 +323,28 @@
</template> </template>
</div> </div>
</textinput> </textinput>
</div> </div>
</clin-fields> </clin-fields>
</div> </div>
<button v-on:click="addClin" type="button"> <button
Add CLIN class="icon-link"
v-on:click="addClin"
type="button">
{{ Icon('plus') }}
<span>Add another CLIN or Sub-CLIN</span>
</button> </button>
{{ UploadInput(form.pdf) }}
</form> <hr>
</to-form> <div class="h3">Upload your supporting documentation</div>
<div>
Upload a single PDF containing all relevant information. {{ Icon('help')}}
</div> </div>
{{ UploadInput(form.pdf) }}
</form>
{{ TotalsBox(task_order=task_order) }}
</div>
</to-form>
{% endblock %} {% endblock %}

View File

@ -302,7 +302,7 @@ forms:
military: Military military: Military
other: Other <em class='description'>(E.g. University or other partner)</em> other: Other <em class='description'>(E.g. University or other partner)</em>
dev_team_other_label: Development Team Other dev_team_other_label: Development Team Other
end_date_label: End Date end_date_label: End of period of performance (PoP)
file_format_not_allowed: Only PDF or PNG files can be uploaded. file_format_not_allowed: Only PDF or PNG files can be uploaded.
first_step_title: Overview first_step_title: Overview
ko_invite_label: Invite contracting officer to Task Order Builder ko_invite_label: Invite contracting officer to Task Order Builder
@ -330,7 +330,7 @@ forms:
skip_invite_description: | skip_invite_description: |
<i>An invitation won't actually be sent until you click Done on the Review page. You can skip this for now and invite them later.</i> <i>An invitation won't actually be sent until you click Done on the Review page. You can skip this for now and invite them later.</i>
so_invite_label: Invite Security Officer to Task Order Builder so_invite_label: Invite Security Officer to Task Order Builder
start_date_label: Start Date start_date_label: Start of period of performance (PoP)
team_experience: team_experience:
built_1: Built, migrated, or consulted on 1-2 applications built_1: Built, migrated, or consulted on 1-2 applications
built_3: Built, migrated, or consulted on 3-5 applications built_3: Built, migrated, or consulted on 3-5 applications