From 2a97ed5dc361396ca4fe9488f19df85eb3965b39 Mon Sep 17 00:00:00 2001 From: Andrew Croce Date: Thu, 13 Sep 2018 12:58:23 -0400 Subject: [PATCH] request approval screen --- atst/routes/requests/approval.py | 2 +- templates/requests/approval.html | 248 +++++++++++++++++-------------- 2 files changed, 138 insertions(+), 112 deletions(-) diff --git a/atst/routes/requests/approval.py b/atst/routes/requests/approval.py index 1843e127..7249f9a4 100644 --- a/atst/routes/requests/approval.py +++ b/atst/routes/requests/approval.py @@ -35,7 +35,7 @@ def render_approval(request, form=None): return render_template( "requests/approval.html", data=data, - status_events=reversed(request.status_events), + reviews=list(reversed(request.reviews)), request=request, current_status=request.status.value, pending_review=pending_review, diff --git a/templates/requests/approval.html b/templates/requests/approval.html index b9559712..a28a35c0 100644 --- a/templates/requests/approval.html +++ b/templates/requests/approval.html @@ -16,8 +16,9 @@ {% endif %}
-
-

Request #{{ request.id }}

+
+

Request #{{ request.id }} +

{{ current_status }}
@@ -32,153 +33,178 @@
{% if pending_review %} -
- {{ f.csrf_token }} -
-
-

Approval Notes

-
+
+ + {{ f.csrf_token }} -
+ +
+
+
+

Review this Request

-
+
+
+ + -

Instructions for the Requestor

+ + +
+
- 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. These notes will be visible to the person making the JEDI Cloud request. +
+

Message to Requestor (optional)

+
+ {{ TextInput( + f.comment, + label='Approval comments or notes', + description='Provide any comments or notes regarding the approval of this request. This message will be shared with the person making the JEDI request..', + paragraph=True, + noMaxWidth=True + ) }} +
- {{ TextInput(f.comment, paragraph=True, placeholder="Add notes or comments explaining what changes are being requested or why further discussion is needed about this request.") }} +
+ {{ TextInput( + f.comment, + label='Revision instructions or notes', + paragraph=True, + noMaxWidth=True + ) }} +
+
-
+
-
-
-

Authorizing Officials

-

This section is not visible to the person making the request. It is only viewable by CCPO staff.

-

Provide the name of the key officials for both parties that have authorized this request to move forward.

+

Authorizing Officials (optional)

+

Provide the name of the key officials for both parties that have authorized this request to move forward. This section is not visible to the person making the request. It is only viewable by CCPO staff.

+
+ +

Mission Authorizing Official

+ +
+
+ {{ TextInput(f.fname_mao, placeholder="First name of mission authorizing official") }} +
+ +
+ {{ TextInput(f.lname_mao, placeholder="Last name of mission authorizing official") }} +
+
+ +
+
+ {{ TextInput(f.email_mao, placeholder="name@mail.mil") }} +
+ +
+ {{ TextInput(f.phone_mao, placeholder="(123) 456-7890", validation='usPhone') }} +
+
+ +
+ +

CCPO Authorizing Official

+ +
+
+ {{ TextInput(f.fname_ccpo, placeholder="First name of CCPO authorizing official") }} +
+ +
+ {{ TextInput(f.lname_ccpo, placeholder="Last name of CCPO authorizing official") }} +
+
+
+
+
+ +
+ + + + {{ Icon('x') }} + Cancel +
-

Mission Authorizing Official

- - -
- -
- {{ TextInput(f.fname_mao, placeholder="First name of mission authorizing official") }} -
- -
- {{ TextInput(f.lname_mao, placeholder="Last name of mission authorizing official") }} -
- -
- -
- -
- {{ TextInput(f.email_mao, placeholder="name@mail.mil") }} -
- - -
- {{ TextInput(f.phone_mao, placeholder="(123) 456-7890", validation='usPhone') }} -
- -
- - -

CCPO Authorizing Official

- -
- -
- {{ TextInput(f.fname_ccpo, placeholder="First name of CCPO authorizing official") }} -
- -
- {{ TextInput(f.lname_ccpo, placeholder="Last name of CCPO authorizing official") }} -
- -
- - - -
- -
- - - - {{ Icon('x') }} - Cancel - -
- + + +
{% endif %} -
-

CCPO Internal Notes

-

You may add additional comments and notes for internal CCPO reference and follow-up here.

-
-
-
- {{ internal_comment_form.csrf_token }} - {{ TextInput(internal_comment_form.text, paragraph=True) }} - -
+ +
+
+
+
+ + {{ internal_comment_form.csrf_token }} + {{ TextInput(internal_comment_form.text, paragraph=True, noMaxWidth=True) }} + +
-
-
+ +
+ +
+
-
-
-

Approval Log

-
-
-
-
    +
    + {% if reviews %} +
    +
    +

    CCPO Activity Log

    +
    - {% for status_event in status_events %} - {% if status_event.review %} +
    +
      + {% for review in reviews %}
    1. -

      {{ status_event.log_name }} by {{ status_event.review.full_name_reviewer }}

      - {% if status_event.review.comment %} -

      {{ status_event.review.comment }}

      +

      {{ review.log_name }} by {{ review.full_name_reviewer }}

      + {% if review.comment %} +

      {{ review.comment }}

      {% endif %}
      - {% if status_event.review.lname_mao %} + {% if review.lname_mao %}

      Mission Owner approval on behalf of:

      - {{ status_event.review.full_name_mao }} - {{ status_event.review.email_mao }} - {{ status_event.review.phone_mao }} + {{ review.full_name_mao }} + {{ review.email_mao }} + {{ review.phone_mao }}
      {% endif %} - {% if status_event.review.lname_ccpo %} + {% if review.lname_ccpo %}

      CCPO approval on behalf of:

      - {{ status_event.review.full_name_ccpo }} + {{ review.full_name_ccpo }}
      {% endif %}
      - {% set timestamp=status_event.time_created | formattedDate("%Y-%m-%d %H:%M:%S %Z") %} + {% set timestamp=review.status.time_created | formattedDate("%Y-%m-%d %H:%M:%S %Z") %}
    2. - {% endif %} - {% endfor %} - -
    + {% endfor %} +
+
- + {% else %} + {{ Alert('CCPO Activity Log', + message='No CCPO approvals or request changes have been recorded yet.', + level='warning' + ) }} + {% endif %}
+ {% endblock %}