[FIX] BASE: Shift and worktype hx create and delete issue, and both request cancelling issue fixes for employee who have no work info

This commit is contained in:
Horilla
2024-05-17 11:17:19 +05:30
parent 588fa6646f
commit b86d11990a
3 changed files with 44 additions and 17 deletions

View File

@@ -56,7 +56,7 @@
<div data-cell-index="6" data-cell-title='{% trans "Description" %}' class="oh-sticky-table__th">{% trans "Description" %}</div>
<div class="oh-sticky-table__th" style="width:115px;">{% trans "Comment" %}</div>
<div class="oh-sticky-table__th" style="width: 192px;">{% trans "Actions" %}</div>
{% if perms.base.change_shiftrequest and shift_request.approved == False or request.user|is_reportingmanager %}
{% if perms.base.change_shiftrequest or request.user|is_reportingmanager %}
<div class="oh-sticky-table__th oh-sticky-table__right " style="width:180px;">{% trans "Confirmation" %}</div>
{% endif %}
</div>
@@ -131,6 +131,11 @@
{% csrf_token %}
<button type='submit' class="oh-btn oh-btn--danger-outline oh-btn--light-bkg w-100" title="{% trans 'Remove' %}"><ion-icon name="trash-outline"></ion-icon></button>
</form>
{% elif perms.base.change_shiftrequest or request.user|is_reportingmanager %}
<form action="{% url 'shift-request-delete' shift_request.id %}" onsubmit="return confirm('{% trans "Are you sure you want to delete this shift request?" %}');" method='post' class="w-75">
{% csrf_token %}
<button type='submit' class="oh-btn oh-btn--danger-outline oh-btn--light-bkg w-100" title="{% trans 'Remove' %}"><ion-icon name="trash-outline"></ion-icon></button>
</form>
{% else %}
<button class="oh-btn oh-btn--light-bkg w-50" disabled><ion-icon name="trash-outline"></ion-icon></button></td>
{% endif %}
@@ -297,10 +302,10 @@
>{% trans "Requested Till" %}</div>
<div data-cell-index="16" data-cell-title='{% trans "Description" %}' class="oh-sticky-table__th">{% trans "Description" %}</div>
<div class="oh-sticky-table__th" style="width:115px;">{% trans "Comment" %}</div>
{% if perms.base.change_shiftrequest and shift_request.approved == False or request.user|is_reportingmanager %}
{% if perms.base.change_shiftrequest or request.user|is_reportingmanager %}
<div class="oh-sticky-table__th">{% trans "Actions" %}</div>
<div class="oh-sticky-table__th oh-sticky-table__right" style="width:180px;">{% trans "Confirmation" %}</div>
{% endif %}
<div class="oh-sticky-table__th oh-sticky-table__right" style="width:180px;">{% trans "Confirmation" %}</div>
</div>
</div>
<div class="oh-sticky-table__tbody">

View File

@@ -25,6 +25,7 @@
hx-target="#view-container"
id="filterForm"
class="d-flex"
onsubmit = "event.preventDefault()"
>
<div class="oh-main__titlebar oh-main__titlebar--right">
{% if data or allocated_data %}