Expand review form if there are errors
This commit is contained in:
parent
a859af9eea
commit
2d7d97a03c
@ -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'
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -85,7 +85,8 @@
|
||||
<form method="POST" action="{{ url_for("requests.submit_approval", request_id=jedi_request.id) }}" autocomplete="off">
|
||||
{{ review_form.csrf_token }}
|
||||
|
||||
<ccpo-approval inline-template>
|
||||
{% set initialState = 'approving' if review_form.errors else '' %}
|
||||
<ccpo-approval inline-template initial-state="{{ initialState }}">
|
||||
<div>
|
||||
<div class='panel'>
|
||||
|
||||
@ -148,7 +149,7 @@
|
||||
|
||||
<div class='usa-input'>
|
||||
<fieldset class='usa-input__choices usa-input__choices--inline'>
|
||||
<input v-on:change='setReview' type='radio' name='review' id='review-approving' value='approving'/>
|
||||
<input v-on:change='setReview' type='radio' name='review' id='review-approving' value='approving' {{ 'checked' if initialState == 'approving' }}/>
|
||||
<label for='review-approving'>Ready for approval</label>
|
||||
|
||||
<input v-on:change='setReview' type='radio' name='review' id='review-denying' value='denying'/>
|
||||
|
Loading…
x
Reference in New Issue
Block a user