Update funding form to handle uploading pdf/png

This commit is contained in:
Patrick Smith
2019-01-21 15:55:37 -05:00
parent 2298c5135e
commit 6a9290619d
7 changed files with 43 additions and 14 deletions

View File

@@ -12,7 +12,11 @@
{% block form %}
<funding inline-template v-bind:initial-data='{{ form.data|tojson }}'>
<funding
inline-template
v-bind:initial-data='{{ form.data|mixedContentToJson }}'
v-bind:upload-errors='{{ form.csp_estimate.errors | list }}'
>
<div>
<!-- Get Funding Section -->
<h3 class="subheading">{{ "task_orders.new.funding.performance_period_title" | translate }}</h3>
@@ -28,13 +32,22 @@
{{ Icon("link")}} Cloud Service Provider's estimate calculator
</a></p>
<p>{{ "task_orders.new.funding.estimate_usage_paragraph" | translate }}</p>
<div class="usa-input">
<div class="usa-input__title">
{{ form.pdf.label }}
<template v-if="showUpload">
<div class="usa-input {% if form.csp_estimate.errors %} usa-input--error {% endif %}">
{{ form.csp_estimate.label }}
{{ form.csp_estimate.description }}
{{ form.csp_estimate }}
{% for error in form.csp_estimate.errors %}
<span class="usa-input__message">{{error}}</span>
{% endfor %}
</div>
{{ form.pdf.description }}
<input type="file" disabled="disabled" />
</div>
</template>
<template v-else>
<p>Uploaded {{ form.csp_estimate.data.filename }}</p>
<div>
<button type="button" v-on:click="showUploadInput">Change</button>
</div>
</template>
<hr>