2019-06-10 12:29:54 -04:00

65 lines
2.4 KiB
HTML

{% extends "portfolios/base.html" %}
{% from 'components/date_picker.html' import DatePicker %}
{% from 'components/save_button.html' import SaveButton %}
{% from 'components/options_input.html' import OptionsInput %}
{% from 'components/text_input.html' import TextInput %}
{% from 'components/upload_input.html' import UploadInput %}
{% macro CLINFields(fields) %}
<div>
{{ OptionsInput(fields.jedi_clin_type) }}
{{ TextInput(fields.number) }}
{{ DatePicker(fields.start_date) }}
{{ DatePicker(fields.end_date) }}
{{ TextInput(fields.obligated_amount) }}
</div>
{% endmacro %}
{% block portfolio_content %}
<div class="col task-order-form">
{% include "fragments/flash.html" %}
<to-form inline-template initial-clin-count='{{ form.clins | length }}'>
{% if task_order_id %}
{% set action = url_for("task_orders.update", portfolio_id=portfolio.id, task_order_id=task_order_id) %}
{% else %}
{% set action = url_for("task_orders.update", portfolio_id=portfolio.id) %}
{% endif %}
<form id="new-task-order" action='{{ action }}' method="POST" autocomplete="off">
{{ form.csrf_token }}
<!-- TODO: implement save bar with component -->
<span class="h3">Add Funding</span>
<a
href="{{ cancel_url }}"
class="action-group__action icon-link">
<span class="icon icon--x"></span>
{{ "common.cancel" | translate }}
</a>
{{ SaveButton(text=('common.save' | translate), element='input', form='new-task-order') }}
<p>
{{ "task_orders.new.form_help_text" | translate }}
</p>
<hr>
{{ TextInput(form.number, validation='taskOrderNumber') }}
{% for clin in form.clins %}
{{ CLINFields(clin) }}
{% endfor %}
<div v-for="clin in clins">
<!-- do something to display this when no clins exist -->
<!-- fix names and ids -->
<!-- make new vue component for clin -->
<!-- try <clin inline-template v-for="clin in clins"> -->
<!-- create CLIN vue component with a template in the component -->
<!-- use it to iterate through or if clinCount === 0 -->
<clin-fields v-bind:clin-index='clinCount'></clin-fields>
</div>
<button v-on:click="addClin" type="button">
Add CLIN
</button>
{{ UploadInput(form.pdf) }}
</form>
</to-form>
</div>
{% endblock %}