Merge pull request #606 from dod-ccpo/upload-pdf-on-ko-review
Upload PDF on KO Review Page
This commit is contained in:
24
templates/components/upload_input.html
Normal file
24
templates/components/upload_input.html
Normal file
@@ -0,0 +1,24 @@
|
||||
{% macro UploadInput(field, show_label=False) -%}
|
||||
<uploadinput inline-template v-bind:initial-data='{{ field.data | tojson }}' v-bind:upload-errors='{{ field.errors | list }}'>
|
||||
<div>
|
||||
<template v-if="showUpload">
|
||||
<div class="usa-input {% if field.errors %} usa-input--error {% endif %}">
|
||||
{% if show_label %}
|
||||
{{ field.label }}
|
||||
{% endif %}
|
||||
{{ field.description }}
|
||||
{{ field }}
|
||||
{% for error in field.errors %}
|
||||
<span class="usa-input__message">{{error}}</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<p>Uploaded {{ field.data.filename }}</p>
|
||||
<div>
|
||||
<button type="button" v-on:click="showUploadInput">Change</button>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</uploadinput>
|
||||
{%- endmacro %}
|
@@ -9,6 +9,7 @@
|
||||
{% from "components/text_input.html" import TextInput %}
|
||||
{% from "components/alert.html" import Alert %}
|
||||
{% from "components/review_field.html" import ReviewField %}
|
||||
{% from "components/upload_input.html" import UploadInput %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
@@ -16,7 +17,10 @@
|
||||
|
||||
{% include "fragments/flash.html" %}
|
||||
|
||||
{% block form_action %}
|
||||
<form method='POST' action="{{ url_for('portfolios.submit_ko_review', portfolio_id=portfolio.id, task_order_id=task_order.id, form=form) }}" autocomplete="off" enctype="multipart/form-data">
|
||||
{% endblock %}
|
||||
|
||||
{{ form.csrf_token }}
|
||||
|
||||
{% block form %}
|
||||
@@ -60,11 +64,7 @@
|
||||
<div class="h2">{{ "task_orders.ko_review.task_order_information"| translate }}</div>
|
||||
|
||||
<div class="form__sub-fields">
|
||||
<div class="usa-input">
|
||||
<div class="usa-input__title">{{ form.pdf.label }}</div>
|
||||
{{ form.pdf.description }}
|
||||
{{ form.pdf }}
|
||||
</div>
|
||||
{{ UploadInput(form.pdf) }}
|
||||
{{ TextInput(form.number) }}
|
||||
{{ TextInput(form.loa) }}
|
||||
{{ TextInput(form.custom_clauses, paragraph=True) }}
|
||||
|
@@ -11,6 +11,7 @@
|
||||
|
||||
{% block form %}
|
||||
|
||||
|
||||
<!-- App Info Section -->
|
||||
<h3 class="task-order-form__heading subheading">{{ "task_orders.new.app_info.basic_info_title"| translate }}</h3>
|
||||
{{ TextInput(form.portfolio_name, placeholder="The name of your office or organization", validation="portfolioName") }}
|
||||
|
@@ -3,6 +3,7 @@
|
||||
{% from "components/text_input.html" import TextInput %}
|
||||
{% from "components/options_input.html" import OptionsInput %}
|
||||
{% from "components/date_input.html" import DateInput %}
|
||||
{% from "components/upload_input.html" import UploadInput %}
|
||||
|
||||
{% from "components/icon.html" import Icon %}
|
||||
|
||||
@@ -32,22 +33,7 @@
|
||||
{{ Icon("link")}} Go to Cloud Service Provider’s estimate calculator
|
||||
</a></p>
|
||||
<p>{{ "task_orders.new.funding.estimate_usage_paragraph" | translate }}</p>
|
||||
<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>
|
||||
</template>
|
||||
<template v-else>
|
||||
<p>Uploaded {{ form.csp_estimate.data.filename }}</p>
|
||||
<div>
|
||||
<button type="button" v-on:click="showUploadInput">Change</button>
|
||||
</div>
|
||||
</template>
|
||||
{{ UploadInput(form.csp_estimate, show_label=True) }}
|
||||
|
||||
<hr>
|
||||
|
||||
|
Reference in New Issue
Block a user