{% extends "main/layout.html" %}
{% block content %}
<ol class="breadcrumb">
	<li class="breadcrumb-item active">{{ legend|upper }}</li>
</ol>
<div class="row">
	<div class="col-sm-12">
		<div class="card shadow-lg border-info rounded">
			<div class="card-header bg-steel">{{ legend|upper }}</div>
			<div class="card-body">
				<center>
					<h4>{{ legend|upper }}</h4>
				</center>
				<hr/>
				<table class="table table-sm table-striped" id="example" width="100%" cellspacing="0">
					<thead>
						<tr>
							<th>Nu.</th>
							<th>Tipu Licenca</th>
							<th>Data Aplika</th>
							<th>Data Hahu</th>
							<th>Data Termina</th>
							<th>Loron</th>
							<th>#</th>
						</tr>
					</thead>
					<tbody>
					{% for obj in objects %}
						<tr>
							<td>{{ forloop.counter }}</td>
							<td>{{ obj.leave_type }}</td>
							<td>{{ obj.date|date:"d/m/Y" }}</td>
							<td>{{ obj.start_date|date:"d/m/Y" }}</td>
							<td>{{ obj.end_date|date:"d/m/Y" }}</td>
							<td>{{ obj.days }}</td>
							<td>
								<a class="btn btn-sm btn-secondary" href="{% url 'leave-detail' obj.hashed %}" title="Detalha"><i class="fa fa-eye"></i></a>
							{% if obj.is_send == False %}
								{% if obj.is_lock == False %}
								<a class="btn btn-sm btn-info" href="{% url 'leave-update' obj.hashed %}" title="Altera"><i class="fa fa-edit"></i></a>
								<a class="btn btn-sm btn-warning" href="{% url 'leave-lock' obj.hashed %}" title="Xavi hodi manda"><i class="fa fa-lock"></i></a>
								{% else %}
								<a class="btn btn-sm btn-warning" href="{% url 'leave-unlock' obj.hashed %}" title="Loke hodi altera"><i class="fa fa-unlock"></i></a>
								<a class="btn btn-sm btn-primary" href="{% url 'leave-send' obj.hashed %}" title="Manda"><i class="fa fa-send"></i></a>
								{% endif %}
							{% endif %}
							</td>
						</tr>
					{% endfor %}
					</tbody>
				</table>
			</div> <!--end card-body-->
		</div> <!--end card-->
	</div> <!--end col-->
</div> <!--end row-->
{% endblock %}
{% block scripts %}
	<script type="text/javascript">
		$(document).ready(function() {
			$('#example').DataTable();
		} );
	</script>
{% endblock %}