From 1aab857a1e0b634d0f75d7200a2043610b2d311e Mon Sep 17 00:00:00 2001 From: leigh-mil Date: Mon, 17 Jun 2019 16:20:55 -0400 Subject: [PATCH] set value of checkbox to false when modal closes --- atst/routes/task_orders/index.py | 4 +--- js/components/submit_confirmation.js | 7 +++++++ templates/components/submit_confirmation.html | 11 +++++++++-- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/atst/routes/task_orders/index.py b/atst/routes/task_orders/index.py index 6ed161b3..ffaf1b8c 100644 --- a/atst/routes/task_orders/index.py +++ b/atst/routes/task_orders/index.py @@ -4,7 +4,7 @@ from . import task_orders_bp from atst.domain.authz.decorator import user_can_access_decorator as user_can from atst.domain.portfolios import Portfolios from atst.domain.task_orders import TaskOrders -from atst.forms.task_order import TaskOrderForm, SignatureForm +from atst.forms.task_order import SignatureForm from atst.models import Permissions from atst.models.task_order import Status as TaskOrderStatus from atst.utils.flash import formatted_flash as flash @@ -14,12 +14,10 @@ from atst.utils.flash import formatted_flash as flash @user_can(Permissions.VIEW_TASK_ORDER_DETAILS, message="review task order details") def review_task_order(task_order_id): task_order = TaskOrders.get(task_order_id) - to_form = TaskOrderForm(number=task_order.number) signature_form = SignatureForm() return render_template( "portfolios/task_orders/review.html", task_order=task_order, - to_form=to_form, signature_form=signature_form, ) diff --git a/js/components/submit_confirmation.js b/js/components/submit_confirmation.js index fd367a1a..c6836bb8 100644 --- a/js/components/submit_confirmation.js +++ b/js/components/submit_confirmation.js @@ -10,6 +10,7 @@ export default { data: function() { return { valid: false, + checked: false, } }, @@ -17,5 +18,11 @@ export default { toggleValid: function() { this.valid = !this.valid }, + + handleClose: function() { + this.$root.closeModal(this.name) + this.checked = false + this.valid = false + }, }, } diff --git a/templates/components/submit_confirmation.html b/templates/components/submit_confirmation.html index 023afe5e..37295823 100644 --- a/templates/components/submit_confirmation.html +++ b/templates/components/submit_confirmation.html @@ -14,7 +14,14 @@ ) }}
- {{ CheckboxInput(field=form.signature) }} +
+
+ + {{ form.signature(**{"v-model": "checked"}) }} + {{ form.signature.label | safe }} + +
+
@@ -24,7 +31,7 @@ {{ submit_text }} - +