{% load i18n static %}

{% if requests %}
<div class="oh-sticky-table h-100">
    <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 "Employee" %}</div>
                <div class="oh-sticky-table__th">{% trans "Requested Work Type" %}</div>
                <div class="oh-sticky-table__th">{% trans "Previous/ Current Work Type" %}</div>
                <div class="oh-sticky-table__th" align="center">{% trans "Actions" %}</div>
            </div>
        </div>
        {% for work_type in requests %}
        <div class="oh-sticky-table__tbody">
            <div
                class="oh-sticky-table__tr"
                hx-get="{% url 'work-type-request-single-view' work_type.id %}?instances_ids={{requests_ids}}&dashboard=true"
                hx-target="#objectDetailsModalTarget"
                data-toggle="oh-modal-toggle"
                data-target="#objectDetailsModal"
            >
                <div class="oh-sticky-table__sd">
                    <div class="oh-profile oh-profile--md">
                        <div class="oh-profile__avatar mr-1">
                            <img
                                src="{{work_type.employee_id.get_avatar}}"
                                class="oh-profile__image"
                                alt="Username"
                            />
                        </div>
                        <span class="oh-profile__name oh-text--dark"
                            >{{work_type.employee_id}}</span
                        >
                    </div>
                </div>
                <div class="oh-sticky-table__td">{{work_type.work_type_id}}</div>
                <div class="oh-sticky-table__td">{{work_type.previous_work_type_id}}</div>
                <div
                    class="oh-sticky-table__td"
                    onclick="event.stopPropagation();"
                >
                    <div class="oh-btn-group float-end">
                        <a
                            href="/work-type-request-approve/{{work_type.id}}/"
							onclick="return confirm('{% trans "Do you want to approve this work type request?" %}')"
                            class="oh-btn oh-btn--success"
                            title="Approve"
                            ><ion-icon name="checkmark-outline"></ion-icon
                        ></a>

                        <a
                            href="/work-type-request-cancel/{{work_type.id}}/"
							onclick="return confirm('{% trans "Do you want to cancel this request?" %}')"
                            class="oh-btn oh-btn--danger"
                            title="cancel"
                            ><ion-icon name="close-circle-outline"></ion-icon
                        ></a>
                    </div>
                </div>
            </div>
        </div>
        {% endfor %}
    </div>
</div>
{% else %}
<div style="height: 380px; display:flex;align-items: center;justify-content: center;" class="">
	<div style="" class="">
		<img style="display: block;width: 70px;margin: 20px auto ;" src="{% static "/images/ui/joiningchart.png" %}" class="" alt=""/>
		<h3 style="font-size:16px" class="oh-404__subtitle">{% trans "No data Found..." %}</h3>
	</div>
</div>
{% endif %}
