diff --git a/atst/forms/task_order.py b/atst/forms/task_order.py index 2585a673..7d02d3a6 100644 --- a/atst/forms/task_order.py +++ b/atst/forms/task_order.py @@ -41,6 +41,7 @@ class TaskOrderForm(BaseForm): ) pdf = FileField( None, + description="Your file may not exceed 50MB", validators=[ FileAllowed(["pdf"], translate("forms.task_order.file_format_not_allowed")), FileLength(message=translate("forms.validators.file_length")), diff --git a/js/components/date_selector.js b/js/components/date_selector.js index 05809b0b..6603cced 100644 --- a/js/components/date_selector.js +++ b/js/components/date_selector.js @@ -20,6 +20,10 @@ export default { mindate: { type: String }, maxdate: { type: String }, nameTag: { type: String }, + watch: { + type: Boolean, + default: false, + }, }, data: function() { @@ -138,7 +142,11 @@ export default { methods: { _emitChange: function(name, value, valid) { - emitEvent('field-change', this, { value, name }) + emitEvent('field-change', this, { + value: value, + name: name, + watch: this.watch, + }) }, }, diff --git a/js/components/forms/to_form.js b/js/components/forms/to_form.js index bf77f3c2..6903ebe4 100644 --- a/js/components/forms/to_form.js +++ b/js/components/forms/to_form.js @@ -1,3 +1,5 @@ +import stickybits from 'stickybits' + import ClinFields from '../clin_fields' import DateSelector from '../date_selector' import FormMixin from '../../mixins/form' @@ -40,4 +42,12 @@ export default { ++this.clinIndex }, }, + + directives: { + sticky: { + inserted: el => { + stickybits(el) + }, + }, + }, } diff --git a/js/components/text_input.js b/js/components/text_input.js index 09367d2d..c49bb075 100644 --- a/js/components/text_input.js +++ b/js/components/text_input.js @@ -27,6 +27,10 @@ export default { paragraph: String, noMaxWidth: String, optional: Boolean, + watch: { + type: Boolean, + default: false, + }, }, data: function() { @@ -122,6 +126,7 @@ export default { value: this._rawValue(value), valid, name: this.name, + watch: this.watch, }) }, diff --git a/js/components/upload_input.js b/js/components/upload_input.js index a94d394a..93c0eb8f 100644 --- a/js/components/upload_input.js +++ b/js/components/upload_input.js @@ -1,6 +1,7 @@ import createNumberMask from 'text-mask-addons/dist/createNumberMask' import { conformToMask } from 'vue-text-mask' +import { emitEvent } from '../lib/emitters' import FormMixin from '../mixins/form' import textinput from './text_input' import optionsinput from './options_input' @@ -22,6 +23,10 @@ export default { initialErrors: { type: Boolean, }, + watch: { + type: Boolean, + default: false, + }, }, data: function() { @@ -38,6 +43,12 @@ export default { this.attachment = e.target.value this.showErrors = false this.changed = true + + emitEvent('field-change', this, { + value: e.target.value, + name: this.name, + watch: this.watch, + }) }, removeAttachment: function(e) { e.preventDefault() @@ -47,6 +58,12 @@ export default { } this.showErrors = false this.changed = true + + emitEvent('field-change', this, { + value: e.target.value, + name: this.name, + watch: this.watch, + }) }, }, diff --git a/static/icons/question.svg b/static/icons/question.svg new file mode 100644 index 00000000..33f994c4 --- /dev/null +++ b/static/icons/question.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/styles/sections/_task_order.scss b/styles/sections/_task_order.scss index e9fcc9b8..e124cdae 100644 --- a/styles/sections/_task_order.scss +++ b/styles/sections/_task_order.scss @@ -58,18 +58,37 @@ } &.task_order__form { + hr { + margin-top: 1.5rem; + } + .totals-box { margin-top: 0; } .icon { left: 100%; + &.icon--question { + @include icon-color($color-blue); + } } - .usa-input--validation--dollars input { + input { max-width: unset; } + .usa-input__title, + .usa-input__title-inline { + font-weight: $font-normal; + } + + .date-picker { + .usa-input__title { + font-weight: $font-bold; + margin-bottom: $gap; + } + } + .usa-form-group-year { margin-right: 0.4rem; } @@ -77,15 +96,65 @@ .usa-alert { margin: 1.5em 0; } - } - .row.row__form-fields { - .col { - margin-left: $gap; + .usa-input { + margin-top: $gap; + margin-bottom: $gap; } - .col:first-child { + .form-row { + margin-bottom: 0; + + .usa-input { + margin-left: $gap; + margin-right: $gap; + } + + .form-col:first-child { + .usa-input { + margin-left: 0; + } + } + + .form-col:last-child { + .usa-input { + margin-right: 0; + } + } + } + + .task-order__loa-fieldset { + .usa-input { + margin: 0; + } + + input { + margin: $gap 0; + } + + input:first-child { + margin-top: 0; + } + + input:last-child { + margin-bottom: 0; + } + } + + button.icon-link { + margin-top: 0; margin-left: 0; + padding-left: 0; + font-size: $base-font-size; + + &.icon-link__add-another-clin { + margin-top: 0; + margin-bottom: 0; + } + } + + .task-order__pdf-help-text { + margin-bottom: 4 * $gap; } } diff --git a/templates/components/date_picker.html b/templates/components/date_picker.html index 55b033bf..ee4edbaa 100644 --- a/templates/components/date_picker.html +++ b/templates/components/date_picker.html @@ -5,7 +5,8 @@ label=field.label | striptags, description=field.description, mindate=None, - maxdate=None) -%} + maxdate=None, + watch=False) -%}
diff --git a/templates/components/text_input.html b/templates/components/text_input.html index e64ed1c0..acbfae80 100644 --- a/templates/components/text_input.html +++ b/templates/components/text_input.html @@ -15,7 +15,8 @@ classes='', noMaxWidth=False, optional=False, - showLabel=True) -%} + showLabel=True, + watch=False) -%}
diff --git a/templates/task_orders/edit.html b/templates/task_orders/edit.html index 6e0c9007..5ee999b1 100644 --- a/templates/task_orders/edit.html +++ b/templates/task_orders/edit.html @@ -12,9 +12,8 @@ {% macro LOAInput() %}
- -
- + +
+ - -
- -
- Start of period of performance (PoP) -
-
- -
- - -
- - -
- -
- - -
- -
- - - -
- -
- {{ Icon("ok", classes="icon--green") }} -
-
-
-
- - -
- -
- End of period of performance (PoP) -
-
- -
- - -
- - -
- -
- - -
- -
- - - -
- -
- {{ Icon("ok", classes="icon--green") }} -
-
-
-
- - -
- - - - - - - - - -
-
-
- -
- - - -
-
Upload your supporting documentation
-
- Upload a single PDF containing all relevant information. {{ Icon('help')}} -
- {{ UploadInput(form.pdf) }} +
+
Upload your supporting documentation
+
+ Upload a single PDF containing all relevant information. {{ Icon('question')}} +
+ {{ UploadInput(form.pdf, watch=True) }} +
+ {{ TotalsBox(task_order=task_order) }}
- {{ TotalsBox(task_order=task_order) }}