display reviewer name and basic review action

This commit is contained in:
dandds 2018-09-10 16:59:47 -04:00
parent c158e9fc35
commit 570d3b69f3
4 changed files with 17 additions and 4 deletions

View File

@ -21,6 +21,10 @@ class RequestReview(Base):
fname_ccpo = Column(String)
lname_ccpo = Column(String)
@property
def full_name_reviewer(self):
return self.reviewer.full_name
@property
def full_name_mao(self):
return "{} {}".format(self.fname_mao, self.lname_mao)

View File

@ -42,3 +42,12 @@ class RequestStatusEvent(Base):
@property
def displayname(self):
return self.new_status.value
@property
def log_name(self):
if self.new_status == RequestStatus.CHANGES_REQUESTED:
return "Denied"
elif self.new_status == RequestStatus.PENDING_FINANCIAL_VERIFICATION:
return "Accepted"
else:
return self.displayname

View File

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

View File

@ -148,7 +148,7 @@
<li>
<article class='approval-log__log-item'>
<div>
<h3 class='approval-log__log-item__header'>Denied by Darth Vader</h3>
<h3 class='approval-log__log-item__header'>{{ status.log_name }} by {{ status.review.full_name_reviewer }}</h3>
{% if status.review.comment %}
<p>{{ status.review.comment }}</p>
{% endif %}
@ -171,13 +171,13 @@
{% endif %}
</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>
{% set timestamp=status.time_created.strftime("%Y-%m-%d %H:%M:%S %Z") %}
<footer class='approval-log__log-item__timestamp'><time datetime='{{ timestamp }}'>{{ timestamp }}</time></footer>
</article>
</li>
{% endif %}
{% endfor %}
</ol>
</div>
</div>