50 lines
2.3 KiB
HTML
50 lines
2.3 KiB
HTML
{% load i18n %}{% load basefilters %}
|
|
{% is_manager_of request.user instance as can_manage %}
|
|
|
|
<div onclick="event.stopPropagation()">
|
|
<div class="oh-btn-group">
|
|
{% if perms.leave.change_leaveallocationrequest or request.user.employee_get == instance.employee_id or can_manage %}
|
|
{% if instance.status == 'requested' %}
|
|
<button
|
|
class="oh-btn oh-btn--light-bkg w-50"
|
|
title="{% trans 'Edit' %}"
|
|
data-toggle="oh-modal-toggle"
|
|
data-target="#genericModal"
|
|
hx-get="{% url 'leave-allocation-request-update' instance.id %}?instance_ids={{instance.ordered_ids}}"
|
|
hx-target="#genericModalBody">
|
|
<ion-icon name="create-outline"></ion-icon>
|
|
</button>
|
|
{% else %}
|
|
<button
|
|
class="oh-btn oh-btn--light-bkg w-50" disabled>
|
|
<ion-icon name="create-outline" ></ion-icon>
|
|
</button>
|
|
{% endif %}
|
|
{% else %}
|
|
<button
|
|
class="oh-btn oh-btn--light-bkg w-50" disabled>
|
|
<ion-icon name="create-outline" ></ion-icon>
|
|
</button>
|
|
{% endif %}
|
|
{% if perms.leave.delete_leaveallocationrequest or request.user.employee_get == instance.employee_id or can_manage %}
|
|
{% if instance.status == 'requested' %}
|
|
<button class="oh-btn oh-btn--danger-outline oh-btn--light-bkg w-50" id="delete-link"
|
|
hx-confirm="{% trans 'Are you sure you want to delete ?' %}"
|
|
hx-post="{% url 'leave-allocation-request-delete' instance.id %}?{{pd}}"
|
|
hx-target="#leave-allocation"
|
|
title="{% trans 'Delete' %}">
|
|
<ion-icon name="trash-outline"></ion-icon>
|
|
</button>
|
|
{% else %}
|
|
<button class="oh-btn oh-btn--light-bkg w-50" disabled>
|
|
<ion-icon name="trash-outline"></ion-icon>
|
|
</button>
|
|
{% endif %}
|
|
{% else %}
|
|
<button class="oh-btn oh-btn--light-bkg w-50" disabled>
|
|
<ion-icon name="trash-outline"></ion-icon>
|
|
</button>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|