From c158e9fc3509e67e902819f6948b6d8a1cdccacd Mon Sep 17 00:00:00 2001 From: dandds Date: Mon, 10 Sep 2018 16:23:27 -0400 Subject: [PATCH] wire request review log for ccpo review screen --- atst/models/request_review.py | 8 ++++ atst/routes/requests/approval.py | 1 + templates/requests/approval.html | 82 +++++++++++++------------------- 3 files changed, 41 insertions(+), 50 deletions(-) diff --git a/atst/models/request_review.py b/atst/models/request_review.py index 3c991ea5..9c1361d2 100644 --- a/atst/models/request_review.py +++ b/atst/models/request_review.py @@ -20,3 +20,11 @@ class RequestReview(Base): phone_mao = Column(String) fname_ccpo = Column(String) lname_ccpo = Column(String) + + @property + def full_name_mao(self): + return "{} {}".format(self.fname_mao, self.lname_mao) + + @property + def full_name_ccpo(self): + return "{} {}".format(self.fname_ccpo, self.lname_ccpo) diff --git a/atst/routes/requests/approval.py b/atst/routes/requests/approval.py index ca02933f..321f6869 100644 --- a/atst/routes/requests/approval.py +++ b/atst/routes/requests/approval.py @@ -35,6 +35,7 @@ def render_approval(request, form=None): return render_template( "requests/approval.html", data=data, + statuses=request.status_events, request_id=request.id, status=request.status.value, pending_review=pending_review, diff --git a/templates/requests/approval.html b/templates/requests/approval.html index 8cf4ec2c..2011d482 100644 --- a/templates/requests/approval.html +++ b/templates/requests/approval.html @@ -142,60 +142,42 @@
    -
  1. -
    -
    -

    Denied by Darth Vader

    -

    "You have failed me for the last time, Admiral. Captain Piett. Yes, my lord. Make ready to land out troops beyond the energy shield and deploy the fleet so that nothing gets off that system."

    -
    -
    -

    Mission Owner approval on behalf of:

    - Grand Moff Tarkin - tarkin@empire.mil - (234) 567-8901 + {% for status in statuses %} + {% if status.review %} +
  2. +
    +
    +

    Denied by Darth Vader

    + {% if status.review.comment %} +

    {{ status.review.comment }}

    + {% endif %} + +
    + {% if status.review.lname_mao %} +
    +

    Mission Owner approval on behalf of:

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

    CCPO approval on behalf of:

    + {{ status.review.full_name_ccpo }} +
    + {% endif %} +
    - -
    -

    CCPO approval on behalf of:

    - Emperor Palpatine - palpatine@empire.mil - (345) 678-9012 -
    -
  3. -
    - -
    -
    -
  4. +
    + + + {% endif %} + {% endfor %} -
  5. -
    -
    -

    Denied by Darth Vader

    -

    "You have failed me for the last time, Admiral. Captain Piett. Yes, my lord. Make ready to land out troops beyond the energy shield and deploy the fleet so that nothing gets off that system."

    - -
    -
    -

    Mission Owner approval on behalf of:

    - Grand Moff Tarkin - tarkin@empire.mil - (234) 567-8901 -
    - -
    -

    CCPO approval on behalf of:

    - Emperor Palpatine - palpatine@empire.mil - (345) 678-9012 -
    -
    -
    - - -
    -