Add route for read-only view of request

This commit is contained in:
Patrick Smith 2018-08-30 11:25:01 -04:00
parent 687ae30268
commit 4d6f51ed7f
2 changed files with 36 additions and 0 deletions

View File

@ -119,6 +119,19 @@ def requests_submit(request_id=None):
return redirect("/requests?modal=pendingCCPOApproval")
@requests_bp.route("/requests/pending/<string:request_id>", methods=["GET"])
def view_pending_request(request_id=None):
request = Requests.get(request_id)
return render_template(
"requests/view_pending.html",
data=request.body,
service_branches=SERVICE_BRANCHES,
assistance_org_types=ASSISTANCE_ORG_TYPES,
data_transfer_amounts=DATA_TRANSFER_AMOUNTS,
completion_date_ranges=COMPLETION_DATE_RANGES,
)
# TODO: generalize this, along with other authorizations, into a policy-pattern
# for authorization in the application
def _check_can_view_request(request_id):

View File

@ -0,0 +1,23 @@
{% extends "base.html" %}
{% from "components/alert.html" import Alert %}
{% block content %}
<div class="col">
<div class="panel">
<div class="panel__heading">
<h1>View Pending Request</h1>
</div>
<div class="panel__content">
{{ Alert('Your request is being reviewed',
message="<p>You cannot edit your submitted request while it is under review. Your request will be reviewed within 3 business days.</p>",
level='warning'
) }}
{% include "requests/_review.html" %}
</div>
</div>
</div>
{% endblock %}