ccpo should only see review form on review screen if request is pending CCPO action

This commit is contained in:
dandds 2018-09-10 12:18:30 -04:00
parent 139103b2ce
commit d3c98523c4
2 changed files with 72 additions and 65 deletions

View File

@ -26,6 +26,9 @@ def task_order_dictionary(task_order):
def render_approval(request, form=None): def render_approval(request, form=None):
data = request.body data = request.body
pending_final_approval = Requests.is_pending_ccpo_approval(request) pending_final_approval = Requests.is_pending_ccpo_approval(request)
pending_review = (
Requests.is_pending_ccpo_acceptance(request) or pending_final_approval
)
if pending_final_approval and request.task_order: if pending_final_approval and request.task_order:
data["task_order"] = task_order_dictionary(request.task_order) data["task_order"] = task_order_dictionary(request.task_order)
@ -34,6 +37,7 @@ def render_approval(request, form=None):
data=data, data=data,
request_id=request.id, request_id=request.id,
status=request.status.value, status=request.status.value,
pending_review=pending_review,
financial_review=pending_final_approval, financial_review=pending_final_approval,
pdf_available=request.task_order and request.task_order.pdf, pdf_available=request.task_order and request.task_order.pdf,
f=form or CCPOReviewForm(), f=form or CCPOReviewForm(),

View File

@ -26,104 +26,107 @@
</section> </section>
<section class='panel'> {% if pending_review %}
<header class='panel__heading'> <section class='panel'>
<h2 class='h3'>Approval Notes</h2> <header class='panel__heading'>
</header> <h2 class='h3'>Approval Notes</h2>
</header>
<div class='panel__content'> <div class='panel__content'>
<div class="form__sub-fields"> <div class="form__sub-fields">
<h3>Instructions for the Requestor</h3> <h3>Instructions for the Requestor</h3>
Provide instructions or notes for additional information that is necessary to approve the request here. The requestor may then re-submit the updated request or initiate contact outside of AT-AT if further discussion is required. <b>These notes will be visible to the person making the JEDI request</b>. Provide instructions or notes for additional information that is necessary to approve the request here. The requestor may then re-submit the updated request or initiate contact outside of AT-AT if further discussion is required. <b>These notes will be visible to the person making the JEDI request</b>.
{{ TextInput(f.comments, paragraph=True, placeholder="Add notes or comments explaining what changes are being requested or why further discussion is needed about this request.") }} {{ TextInput(f.comments, paragraph=True, placeholder="Add notes or comments explaining what changes are being requested or why further discussion is needed about this request.") }}
</div>
<div class="form-row">
<div class="form-col">
<h3>Authorizing Officials</h3>
<p>This section is not visible to the person making the request. It is only viewable by CCPO staff.</p>
<p>Provide the name of the key officials for both parties that have authorized this request to move forward.</p>
</div> </div>
</div>
<h4 class="h3">Mission Authorizing Official</h4>
<div class='form-row'> <div class="form-row">
<div class="form-col">
<h3>Authorizing Officials</h3>
<p>This section is not visible to the person making the request. It is only viewable by CCPO staff.</p>
<p>Provide the name of the key officials for both parties that have authorized this request to move forward.</p>
</div>
</div>
<h4 class="h3">Mission Authorizing Official</h4>
<div class='form-row'>
<div class='form-col form-col--half'>
{{ TextInput(f.fname_mao, placeholder="First name of mission authorizing official") }}
</div>
<div class='form-col form-col--half'>
{{ TextInput(f.lname_mao, placeholder="Last name of mission authorizing official") }}
</div>
<div class='form-col form-col--half'>
{{ TextInput(f.fname_mao, placeholder="First name of mission authorizing official") }}
</div> </div>
<div class='form-col form-col--half'> <div class='form-row'>
{{ TextInput(f.lname_mao, placeholder="Last name of mission authorizing official") }}
</div>
</div> <div class='form-col form-col--half'>
{{ TextInput(f.email_mao, placeholder="name@mail.mil") }}
</div>
<div class='form-row'>
<div class='form-col form-col--half'> <div class='form-col form-col--half'>
{{ TextInput(f.email_mao, placeholder="name@mail.mil") }} {{ TextInput(f.phone_mao, placeholder="(123) 456-7890", validation='usPhone') }}
</div>
</div> </div>
<div class='form-col form-col--half'> <h4 class="h3">CCPO Authorizing Official</h4>
{{ TextInput(f.phone_mao, placeholder="(123) 456-7890", validation='usPhone') }}
<div class='form-row'>
<div class='form-col form-col--half'>
{{ TextInput(f.fname_ccpo, placeholder="First name of CCPO authorizing official") }}
</div>
<div class='form-col form-col--half'>
{{ TextInput(f.lname_ccpo, placeholder="Last name of CCPO authorizing official") }}
</div>
</div> </div>
</div>
<h4 class="h3">CCPO Authorizing Official</h4> <h4 class="h3">CCPO Internal Notes</h4>
<div class='form-row'> <p>You may add additional comments and notes for internal CCPO reference and follow-up here.</p>
<div class='form-col form-col--half'> <div class='form-row'>
{{ TextInput(f.fname_ccpo, placeholder="First name of CCPO authorizing official") }}
</div>
<div class='form-col form-col--half'> <div class='form-col'>
{{ TextInput(f.lname_ccpo, placeholder="Last name of CCPO authorizing official") }}
</div>
</div> <div class='usa-input'>
<label for='notes'>Internal Comments <em>(optional)</em></label>
<textarea id='notes' placeholder='Add notes or comments for internal CCPO reference.'/></textarea>
</div>
<h4 class="h3">CCPO Internal Notes</h4>
<p>You may add additional comments and notes for internal CCPO reference and follow-up here.</p>
<div class='form-row'>
<div class='form-col'>
<div class='usa-input'>
<label for='notes'>Internal Comments <em>(optional)</em></label>
<textarea id='notes' placeholder='Add notes or comments for internal CCPO reference.'/></textarea>
</div> </div>
</div> </div>
</div> </div>
</div> </section>
</section> <section class='action-group'>
<input type="submit" name="approved" class='usa-button usa-button-big' value='Approve Request'>
<section class='action-group'> <input type="submit" name="denied" class='usa-button usa-button-big usa-button-secondary' value='Mark as Changes Requested'>
<input type="submit" name="approved" class='usa-button usa-button-big' value='Approve Request'> <a href='{{ url_for("requests.requests_index") }}' class='icon-link'>
<input type="submit" name="denied" class='usa-button usa-button-big usa-button-secondary' value='Mark as Changes Requested'> {{ Icon('x') }}
<a href='{{ url_for("requests.requests_index") }}' class='icon-link'> <span>Cancel</span>
{{ Icon('x') }} </a>
<span>Cancel</span> </section>
</a> {% endif %}
</section>
<section class='panel'> <section class='panel'>
<header class='panel__heading'> <header class='panel__heading'>