Add validator to TO number input and add cancel button to form

This commit is contained in:
leigh-mil
2019-06-03 13:24:37 -04:00
committed by Montana
parent d7d239d406
commit 0a2d241dc4
5 changed files with 132 additions and 95 deletions

View File

@@ -0,0 +1,30 @@
{% extends "base.html" %}
{% from 'components/save_button.html' import SaveButton %}
{% from 'components/text_input.html' import TextInput %}
{% block content %}
<div class="col task-order-form">
{% include "fragments/flash.html" %}
<div class="panel">
{% block portfolio_header %}
{% include "portfolios/header.html" %}
{% endblock %}
<base-form inline-template>
<form id="new-task-order" action='{{ url_for("task_orders.create", portfolio_id=portfolio.id) }}' method="POST" autocomplete="off">
{{ form.csrf_token }}
<div class="panel__content">
<!-- TODO: implement save bar with component -->
<span class="h3">Add Funding</span>
{{ SaveButton(text=('common.save' | translate), element='input', form='new-task-order') }}
</div>
<div class="panel__content">
{{ "task_orders.new.form_help_text" | translate }}
<hr>
{{ TextInput(form.number, validation='taskOrderNumber') }}
</div>
</form>
</base-form>
</div>
</div>
{% endblock %}

View File

@@ -16,12 +16,18 @@
<div class="panel__content">
<!-- 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') }}
</div>
<div class="panel__content">
{{ "task_orders.new.form_help_text" | translate }}
<hr>
{{ TextInput(form.number) }}
{{ TextInput(form.number, validation='taskOrderNumber') }}
</div>
</form>
</base-form>