From 2d7d97a03ca594337576e92e867de8ee9115db66 Mon Sep 17 00:00:00 2001 From: Patrick Smith Date: Thu, 27 Sep 2018 18:34:52 -0400 Subject: [PATCH] Expand review form if there are errors --- js/components/forms/ccpo_approval.js | 8 ++++++-- templates/requests/approval.html | 5 +++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/js/components/forms/ccpo_approval.js b/js/components/forms/ccpo_approval.js index a00abde3..f286a594 100644 --- a/js/components/forms/ccpo_approval.js +++ b/js/components/forms/ccpo_approval.js @@ -9,10 +9,14 @@ export default { LocalDatetime }, + props: { + initialState: String + }, + data: function () { return { - approving: false, - denying: false + approving: this.initialState === 'approving', + denying: this.initialState === 'denying' } }, diff --git a/templates/requests/approval.html b/templates/requests/approval.html index 3aacf79e..bd7c99ba 100644 --- a/templates/requests/approval.html +++ b/templates/requests/approval.html @@ -85,7 +85,8 @@
{{ review_form.csrf_token }} - + {% set initialState = 'approving' if review_form.errors else '' %} +
@@ -148,7 +149,7 @@
- +