{% extends "base.html" %} {% from "components/icon.html" import Icon %} {% from "components/text_input.html" import TextInput %} {% from "components/phone_input.html" import PhoneInput %} {% block content %}
{% include "fragments/flash.html" %}

{{ "requests.approval.request_title" | translate({ "displayname": jedi_request.displayname }) }}

{{ current_status }}
{% with data=data, request_id=jedi_request.id %} {% include "requests/_review.html" %} {% endwith %}

{{ "requests.approval.ccpo_internal_comments" | translate }}

{% if comments %}
    {% for comment in comments %}
  1. {{ comment.user.full_name }}

    {{ comment.text }}

    {% set timestamp=comment.time_created | formattedDate("%Y-%m-%d %H:%M:%S %Z") %}
  2. {% endfor %}
{% else %}

{{ "requests.approval.no_ccpo_comments" | translate }}

{% endif %}

{{ "requests.approval.add_comment" | translate }}

{{ internal_comment_form.csrf_token }} {{ TextInput(internal_comment_form.text, paragraph=True, noMaxWidth=True) }}
{{ review_form.csrf_token }} {% set initialState = 'approving' if review_form.errors else '' %}

{{ "requests.approval.ccpo_review_activity" | translate }}

{% if reviews %}
    {% for review in reviews %}
  1. {{ review.status.log_name }} by {{ review.full_name_reviewer }}

    {% if review.comment %}

    {{ review.comment }}

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

    {{ "requests.approval.mission_owner_approval_on_behalf_of" | translate }}

    {{ review.full_name_mao }} {{ review.email_mao }} {{ review.phone_mao }} {% if review.phone_ext_mao %} ext. {{ review.phone_ext_mao }} {% endif %}
    {% endif %} {% if review.lname_ccpo %}

    {{ "requests.approval.ccpo_approval_on_behalf_of" | translate }}

    {{ review.full_name_ccpo }}
    {% endif %}
    {% set timestamp=review.status.time_created | formattedDate("%Y-%m-%d %H:%M:%S %Z") %}
  2. {% endfor %}
{% else %}

{{ "requests.approval.no_ccpo_approval_request_changes" | translate }}

{% endif %}
{% if jedi_request.is_pending_ccpo_action %}

{{ "requests.approval.review_request" | translate }}

Message to Requestor (optional)

{{ TextInput( review_form.comment, label=("requests.approval.approve_comments_or_notes_label" | translate), description=("requests.approval.approve_comments_or_notes_description" | translate), paragraph=True, noMaxWidth=True ) }}
{{ TextInput( review_form.comment, label=("requests.approval.revision_instructions_or_notes_label" | translate), paragraph=True, noMaxWidth=True ) }}

{{ "requests.approval.authorizing_officials_title" | translate }} (optional)

{{ "requests.approval.authorizing_officials_paragraph" | translate }}


{{ "requests.approval.mission_authorizing_official_title" | translate }}

{{ TextInput(review_form.fname_mao, placeholder="First name of mission authorizing official") }}
{{ TextInput(review_form.lname_mao, placeholder="Last name of mission authorizing official") }}
{{ TextInput(review_form.email_mao, placeholder="name@mail.mil", validation='email') }} {{ PhoneInput(review_form.phone_mao, review_form.phone_ext_mao) }}

{{ "requests.approval.ccpo_authorizing_official_title" | translate }}

{{ TextInput(review_form.fname_ccpo, placeholder="First name of CCPO authorizing official") }}
{{ TextInput(review_form.lname_ccpo, placeholder="Last name of CCPO authorizing official") }}
{% endif %}
{% if jedi_request.is_pending_ccpo_action %}
{{ Icon('x') }} Cancel
{% endif %}
{% endblock %}