Don't display add button if not a case manager or admin

Display highlighting for referrals close to expiration
Highlight hours if < 40
This commit is contained in:
Ryan Prather 2024-12-17 12:07:13 -05:00
parent 6287ec6e2f
commit c76783b79f

View File

@ -15,9 +15,11 @@
<div> <div>
<h6 class="text-white text-capitalize ps-3">Referral List</h6> <h6 class="text-white text-capitalize ps-3">Referral List</h6>
</div> </div>
{% if is_granted('ROLE_ADMIN') or is_granted('ROLE_CASE_MANAGER') %}
<div> <div>
<button type="button" class="btn btn-block btn-light mb-3" onclick="window.open('{{ path('app_case_add_referral', {id: case.id}) }}', '_self')">Add Referral</button> <button type="button" class="btn btn-block btn-light mb-3" onclick="window.open('{{ path('app_case_add_referral', {id: case.id}) }}', '_self')">Add Referral</button>
</div> </div>
{% endif %}
</div> </div>
</div> </div>
<div class="card-body px-0 pb-2"> <div class="card-body px-0 pb-2">
@ -37,6 +39,12 @@
</thead> </thead>
<tbody> <tbody>
{% for r in openReferrals %} {% for r in openReferrals %}
{% set dateEndWarning = '' %}
{% if date('+14 days') >= r.endDate %}
{% set dateEndWarning = 'bg-gradient-danger text-white' %}
{% elseif date('+28 days') >= r.endDate %}
{% set dateEndWarning = 'bg-gradient-faded-warning' %}
{% endif %}
<tr> <tr>
<td> <td>
<h6 class='mb-0 text-small'>{{ r.referralId }}</h6> <h6 class='mb-0 text-small'>{{ r.referralId }}</h6>
@ -44,13 +52,13 @@
<td> <td>
<p class='text-xs font-weight-bold mb-0'>{{ r.serviceCode.value }}</p> <p class='text-xs font-weight-bold mb-0'>{{ r.serviceCode.value }}</p>
</td> </td>
<td> <td class='text-center {% if r.getHoursRemaining() < 40 %}bg-gradient-danger text-white{% endif %}'>
<p class='text-xs font-weight-bold mb-0'>{{ r.hours }}</p> <p class='text-xs font-weight-bold mb-0'>{{ r.hours }} / {{ r.getHoursRemaining() }}</p>
</td> </td>
<td> <td class='text-center {{ dateEndWarning }}'>
<p class='text-xs font-weight-bold mb-0'>{{ r.endDate|date("F j, Y") }}</p> <p class='text-xs font-weight-bold mb-0'>{{ r.endDate|date("M j, Y") }}</p>
</td> </td>
<td class='align-right'> <td class='text-center'>
<a href='{{ path('app_case_edit_referral', {caseId: case.id, referralId: r.id}) }}' class='' title='Edit Referral' data-toggle='tooltip'> <a href='{{ path('app_case_edit_referral', {caseId: case.id, referralId: r.id}) }}' class='' title='Edit Referral' data-toggle='tooltip'>
<i class="material-symbols-rounded opacity-5">edit</i> <i class="material-symbols-rounded opacity-5">edit</i>
</a> </a>