change requests index column names depending on user role
This commit is contained in:
parent
7fef858d24
commit
d921aaa2be
@ -10,6 +10,7 @@ def map_request(request):
|
|||||||
time_created = pendulum.instance(request.time_created)
|
time_created = pendulum.instance(request.time_created)
|
||||||
is_new = time_created.add(days=1) > pendulum.now()
|
is_new = time_created.add(days=1) > pendulum.now()
|
||||||
app_count = request.body.get("details_of_use", {}).get("num_software_systems", 0)
|
app_count = request.body.get("details_of_use", {}).get("num_software_systems", 0)
|
||||||
|
annual_usage = request.body.get("details_of_use", {}).get("dollar_value", 0)
|
||||||
update_url = url_for(
|
update_url = url_for(
|
||||||
"requests.requests_form_update", screen=1, request_id=request.id
|
"requests.requests_form_update", screen=1, request_id=request.id
|
||||||
)
|
)
|
||||||
@ -22,6 +23,7 @@ def map_request(request):
|
|||||||
"app_count": app_count,
|
"app_count": app_count,
|
||||||
"date": time_created.format("M/DD/YYYY"),
|
"date": time_created.format("M/DD/YYYY"),
|
||||||
"full_name": request.creator.full_name,
|
"full_name": request.creator.full_name,
|
||||||
|
"annual_usage": annual_usage,
|
||||||
"edit_link": verify_url if Requests.is_pending_financial_verification(
|
"edit_link": verify_url if Requests.is_pending_financial_verification(
|
||||||
request
|
request
|
||||||
) else update_url,
|
) else update_url,
|
||||||
@ -47,4 +49,5 @@ def requests_index():
|
|||||||
requests=mapped_requests,
|
requests=mapped_requests,
|
||||||
pending_financial_verification=pending_fv,
|
pending_financial_verification=pending_fv,
|
||||||
pending_ccpo_approval=pending_ccpo,
|
pending_ccpo_approval=pending_ccpo,
|
||||||
|
extended_view=is_ccpo
|
||||||
)
|
)
|
||||||
|
@ -65,25 +65,27 @@
|
|||||||
|
|
||||||
<div class="col col--grow">
|
<div class="col col--grow">
|
||||||
|
|
||||||
<form class='search-bar'>
|
{% if extended_view %}
|
||||||
<div class='usa-input search-input'>
|
<form class='search-bar'>
|
||||||
<label for='requests-search'>Search requests by Order ID</label>
|
<div class='usa-input search-input'>
|
||||||
<input type='search' id='requests-search' name='requests-search' placeholder="Search by Order ID"/>
|
<label for='requests-search'>Search requests by Order ID</label>
|
||||||
<button type="submit">
|
<input type='search' id='requests-search' name='requests-search' placeholder="Search by Order ID"/>
|
||||||
<span class="hide">Search</span>
|
<button type="submit">
|
||||||
</button>
|
<span class="hide">Search</span>
|
||||||
</div>
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class='usa-input'>
|
<div class='usa-input'>
|
||||||
<label for='filter-status'>Filter requests by status</label>
|
<label for='filter-status'>Filter requests by status</label>
|
||||||
<select id="filter-status" name="filter-status">
|
<select id="filter-status" name="filter-status">
|
||||||
<option value="" selected disabled>Filter by status</option>
|
<option value="" selected disabled>Filter by status</option>
|
||||||
<option value="">Active</option>
|
<option value="">Active</option>
|
||||||
<option value="">Pending</option>
|
<option value="">Pending</option>
|
||||||
<option value="">Denied</option>
|
<option value="">Denied</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<div class='responsive-table-wrapper'>
|
<div class='responsive-table-wrapper'>
|
||||||
<table>
|
<table>
|
||||||
@ -91,8 +93,12 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th scope="col">Order ID</th>
|
<th scope="col">Order ID</th>
|
||||||
<th scope="col">Request Date</th>
|
<th scope="col">Request Date</th>
|
||||||
<th scope="col">Requester</th>
|
{% if extended_view %}
|
||||||
<th scope="col">Total Apps</th>
|
<th scope="col">Requester</th>
|
||||||
|
<th scope="col">Total Apps</th>
|
||||||
|
{% else %}
|
||||||
|
<th scope="col">Annual Usage</th>
|
||||||
|
{% endif %}
|
||||||
<th scope="col">Status</th>
|
<th scope="col">Status</th>
|
||||||
<th scope="col" class="table-cell--shrink">Actions</th>
|
<th scope="col" class="table-cell--shrink">Actions</th>
|
||||||
</tr>
|
</tr>
|
||||||
@ -106,8 +112,12 @@
|
|||||||
</th>
|
</th>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<td>{{ r['date'] }}</td>
|
<td>{{ r['date'] }}</td>
|
||||||
<td>{{ r['full_name'] }}</td>
|
{% if extended_view %}
|
||||||
<td>{{ r['app_count'] }}</td>
|
<td>{{ r['full_name'] }}</td>
|
||||||
|
<td>{{ r['app_count'] }}</td>
|
||||||
|
{% else %}
|
||||||
|
<td>{{ r['annual_usage'] }}</td>
|
||||||
|
{% endif %}
|
||||||
<td>{{ r['status'] }}</td>
|
<td>{{ r['status'] }}</td>
|
||||||
<td class="table-cell--shrink">
|
<td class="table-cell--shrink">
|
||||||
<a href="" class='icon-link'>Download</a>
|
<a href="" class='icon-link'>Download</a>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user