wire request review log for ccpo review screen

This commit is contained in:
dandds 2018-09-10 16:23:27 -04:00
parent 5a7ca5e887
commit c158e9fc35
3 changed files with 41 additions and 50 deletions

View File

@ -20,3 +20,11 @@ class RequestReview(Base):
phone_mao = Column(String) phone_mao = Column(String)
fname_ccpo = Column(String) fname_ccpo = Column(String)
lname_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)

View File

@ -35,6 +35,7 @@ def render_approval(request, form=None):
return render_template( return render_template(
"requests/approval.html", "requests/approval.html",
data=data, data=data,
statuses=request.status_events,
request_id=request.id, request_id=request.id,
status=request.status.value, status=request.status.value,
pending_review=pending_review, pending_review=pending_review,

View File

@ -142,60 +142,42 @@
<div> <div>
<div class='approval-log'> <div class='approval-log'>
<ol> <ol>
{% for status in statuses %}
{% if status.review %}
<li> <li>
<article class='approval-log__log-item'> <article class='approval-log__log-item'>
<div> <div>
<h3 class='approval-log__log-item__header'>Denied by Darth Vader</h3> <h3 class='approval-log__log-item__header'>Denied by Darth Vader</h3>
<p>"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."</p> {% if status.review.comment %}
<p>{{ status.review.comment }}</p>
{% endif %}
<div class='approval-log__behalfs'> <div class='approval-log__behalfs'>
{% if status.review.lname_mao %}
<div class='approval-log__behalf'> <div class='approval-log__behalf'>
<h3 class='approval-log__log-item__header'>Mission Owner approval on behalf of:</h3> <h3 class='approval-log__log-item__header'>Mission Owner approval on behalf of:</h3>
<span>Grand Moff Tarkin</span> <span>{{ status.review.full_name_mao }}</span>
<span>tarkin@empire.mil</span> <span>{{ status.review.email_mao }}</span>
<span>(234) 567-8901</span> <span>{{ status.review.phone_mao }}</span>
</div> </div>
{% endif %}
{% if status.review.lname_ccpo %}
<div class='approval-log__behalf'> <div class='approval-log__behalf'>
<h3 class='approval-log__log-item__header'>CCPO approval on behalf of:</h3> <h3 class='approval-log__log-item__header'>CCPO approval on behalf of:</h3>
<span>Emperor Palpatine</span> <span>{{ status.review.full_name_ccpo }}</span>
<span>palpatine@empire.mil</span> </div>
<span>(345) 678-9012</span> {% endif %}
</div> </div>
</div> </div>
</div> <footer class='approval-log__log-item__timestamp'><time datetime='2018-07-02 04:23:02 EST'>{{ status.time_created.strftime("%Y-%m-%d %H:%M:%S %Z") }}</time></footer>
<footer class='approval-log__log-item__timestamp'><time datetime='2018-07-02 04:23:02 EST'>2018-07-02 04:23:02 EST</time></footer>
</article> </article>
</li> </li>
{% endif %}
{% endfor %}
<li>
<article class='approval-log__log-item'>
<div>
<h3 class='approval-log__log-item__header'>Denied by Darth Vader</h3>
<p>"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."</p>
<div class='approval-log__behalfs'>
<div class='approval-log__behalf'>
<h3 class='approval-log__log-item__header'>Mission Owner approval on behalf of:</h3>
<span>Grand Moff Tarkin</span>
<span>tarkin@empire.mil</span>
<span>(234) 567-8901</span>
</div>
<div class='approval-log__behalf'>
<h3 class='approval-log__log-item__header'>CCPO approval on behalf of:</h3>
<span>Emperor Palpatine</span>
<span>palpatine@empire.mil</span>
<span>(345) 678-9012</span>
</div>
</div>
</div>
<footer class='approval-log__log-item__timestamp'><time datetime='2018-07-02 04:23:02 EST'>2018-07-02 04:23:02 EST</time></footer>
</article>
</li>
</ol> </ol>
</div> </div>
</div> </div>