Files
ihrm/leave/templates/cbv/leave_allocation_request/action_column.html

35 lines
1.5 KiB
HTML

{% load i18n %}
<div onclick="event.stopPropagation()">
<div class="oh-btn-group">
{% 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 %}
{% 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 %}
</div>
</div>