Move submit buttons inside form and add formaction to review button
This commit is contained in:
parent
4e46827335
commit
db58c64a89
@ -56,6 +56,9 @@ def update(portfolio_id=None, task_order_id=None):
|
|||||||
else:
|
else:
|
||||||
task_order = TaskOrders.create(g.current_user, portfolio_id, **form.data)
|
task_order = TaskOrders.create(g.current_user, portfolio_id, **form.data)
|
||||||
|
|
||||||
|
if http_request.args.get('review'):
|
||||||
|
return redirect(url_for("task_orders.review_task_order", task_order_id=task_order.id))
|
||||||
|
|
||||||
flash("task_order_draft")
|
flash("task_order_draft")
|
||||||
|
|
||||||
return redirect(url_for("task_orders.edit", task_order_id=task_order.id))
|
return redirect(url_for("task_orders.edit", task_order_id=task_order.id))
|
||||||
|
@ -84,9 +84,19 @@
|
|||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|
||||||
{% block portfolio_content %}
|
{% block portfolio_content %}
|
||||||
|
{% if task_order_id %}
|
||||||
|
{% set action = url_for("task_orders.update", task_order_id=task_order_id) %}
|
||||||
|
{% set review_action = url_for("task_orders.update", task_order_id=task_order_id, review=True) %}
|
||||||
|
{% else %}
|
||||||
|
{% set action = url_for("task_orders.update", portfolio_id=portfolio.id) %}
|
||||||
|
{% set review_action = url_for("task_orders.update", portfolio_id=portfolio.id, review=True) %}
|
||||||
|
{% endif %}
|
||||||
|
<form id="new-task-order" class="task_order__form" action='{{ action }}' method="POST" autocomplete="off" enctype="multipart/form-data">
|
||||||
|
{{ form.csrf_token }}
|
||||||
|
|
||||||
{% call StickyCTA(text="Add Funding") %}
|
{% call StickyCTA(text="Add Funding") %}
|
||||||
<span class="action-group">
|
<span class="action-group">
|
||||||
<input type="submit" tabindex="0" value="Review task order" form="new-task-order" class="usa-button usa-button-primary">
|
<input type="submit" formaction="{{ review_action }}" tabindex="0" value="Review task order" form="new-task-order" class="usa-button usa-button-primary">
|
||||||
<input type="submit" tabindex="0" value="Save" form="new-task-order" class="usa-button usa-button-secondary">
|
<input type="submit" tabindex="0" value="Save" form="new-task-order" class="usa-button usa-button-secondary">
|
||||||
<a
|
<a
|
||||||
href="{{ cancel_url }}"
|
href="{{ cancel_url }}"
|
||||||
@ -99,14 +109,6 @@
|
|||||||
<to-form inline-template v-bind:initial-clin-count="{{ form.clins.data | length }}">
|
<to-form inline-template v-bind:initial-clin-count="{{ form.clins.data | length }}">
|
||||||
<div class="task-order">
|
<div class="task-order">
|
||||||
{% include "fragments/flash.html" %}
|
{% include "fragments/flash.html" %}
|
||||||
{% if task_order_id %}
|
|
||||||
{% set action = url_for("task_orders.update", task_order_id=task_order_id) %}
|
|
||||||
{% else %}
|
|
||||||
{% set action = url_for("task_orders.update", portfolio_id=portfolio.id) %}
|
|
||||||
{% endif %}
|
|
||||||
<form id="new-task-order" class="task_order__form" action='{{ action }}' method="POST" autocomplete="off" enctype="multipart/form-data">
|
|
||||||
{{ form.csrf_token }}
|
|
||||||
|
|
||||||
{{ SemiCollapsibleText(paragraph="task_orders.new.form_help_text" | translate) }}
|
{{ SemiCollapsibleText(paragraph="task_orders.new.form_help_text" | translate) }}
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
@ -352,8 +354,8 @@
|
|||||||
</div>
|
</div>
|
||||||
{{ TotalsBox(task_order=task_order) }}
|
{{ TotalsBox(task_order=task_order) }}
|
||||||
</div>
|
</div>
|
||||||
</form>
|
|
||||||
</div>
|
</div>
|
||||||
</to-form>
|
</to-form>
|
||||||
|
</form>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user