{% load i18n %}
<div class="oh-sticky-table">
	<div class="oh-sticky-table__table oh-table--sortable">
		<div class="oh-sticky-table__thead">
			<div class="oh-sticky-table__tr">
				<div class="oh-sticky-table__th">{% trans "Reject Reasons" %}</div>
				<div class="oh-sticky-table__th">{% trans "Description" %}</div>
				{% if perms.base.change_department or perms.base.delete_department %}
					<div class="oh-sticky-table__th">{% trans "Actions" %}</div>
				{% endif %}
			</div>
		</div>
		<div class="oh-sticky-table__tbody">
			{% for reason in reject_reasons %}
			<div class="oh-sticky-table__tr" draggable="true">
				<div class="oh-sticky-table__td">{{reason.title}}</div>
				<div class="oh-sticky-table__td">{{reason.description}}</div>
				{% if perms.base.change_department or perms.base.delete_department %}
					<div class="oh-sticky-table__td">
						<div class="oh-btn-group">
							{% if perms.base.change_department %}
							<a
                                data-toggle="oh-modal-toggle"
                                data-target="#rejectReasonModal"
                                hx-get="{% url 'create-reject-reason' %}?instance_id={{reason.id}}"
                                hx-target="#rejectReasonModalBody"
								type="button"
								class="oh-btn oh-btn--light-bkg w-50"
								title="{% trans 'Edit' %}"
							>
								<ion-icon name="create-outline"></ion-icon
							></a>
							{% endif %}
							{% if perms.base.delete_deaprtment %}
                            <a onclick="return confirm('{% trans "Are you sure want to delete this reason?" %}')"
                                href="{% url 'delete-reject-reasons' %}?ids={{reason.id}}"
                                class="oh-btn oh-btn--danger-outline oh-btn--light-bkg w-50"
                                title="{% trans 'Remove' %}"
                            >
                                <ion-icon name="trash-outline"></ion-icon>
                            </a>
							{% endif %}
						</div>
					</div>
				{% endif %}
			</div>
			{% endfor %}
		</div>
	</div>
</div>
