{% for user_leave in user_leaves %}
{% if perms.leave.view_leavetype or perms.leave.view_leaverequest or request.user|check_manager:employee_leave or request.user == user_leave.employee_id.employee_user_id %}
{% if user_leave.leave_type_id.icon %}
{% else %}
{% endif %}
{{user_leave.leave_type_id}}{% trans "Available Leave Days" %} :
{% if user_leave.leave_type_id.limit_leave %}{{user_leave.available_days}}{% else %}{% trans "No Limit" %}{% endif %} {% trans "Carryforward Leave Days" %} :
{{user_leave.carryforward_days}} {% trans "Total Leave Days" %} :
{% if user_leave.leave_type_id.limit_leave %}{{user_leave.total_leave_days}}{% else %}{% trans "No Limit" %}{% endif %} {% trans "Total Leave taken" %} :{{user_leave.leave_taken}}
{% endif %}
{% endfor %}
{% elif employee_leaves %}
{% for employee_leave in employee_leaves %}
{% if perms.leave.view_leavetype or perms.leave.view_leaverequest or request.user|check_manager:employee_leave or request.user == employee_leave.employee_id.employee_user_id %}
{% if employee_leave.leave_type_id.icon %}
{% else %}
{% endif %}
{{employee_leave.leave_type_id}}{% trans "Available Leave Days" %} :
{% if employee_leave.leave_type_id.limit_leave %}{{employee_leave.available_days}}{% else %}{% trans "No Limit" %}{% endif %} {% trans "Carryforward Leave Days" %} :
{{employee_leave.carryforward_days}} {% trans "Total Leave Days" %} :
{% if employee_leave.leave_type_id.limit_leave %}{{employee_leave.total_leave_days}}{% else %}{% trans "No Limit" %}{% endif %} {% trans "Total Leave taken" %} :{{employee_leave.leave_taken}}
{% endif %}
{% endfor %}
{% else %}
{% trans "No Leave Types have been assigned." %}
{% endif %}
{% if employee_leaves or user_leaves %}
{% if employee.leaverequest_set.all %}
{% trans "Leave Type" %}
{% trans "Start Date" %}
{% trans "End Date" %}
{% trans "Requested days" %}
{% trans "Status" %}
{% if perms.leave.change_leaverequest %}
{% endif %}
{% for leave_request in employee.leaverequest_set.all %}
{% if leave_request.leave_type_id.icon %}
{% else%}
{% endif %}