{% extends "main/layout.html" %}
{% load humanize %}
{% block content %}
<div class="breadcrumb-holder">
	<div class="container-fluid">
		<ul class="breadcrumb">
			<li class="breadcrumb-item"><a href="{% url 'cont-dash' %}">PAINEL KONTRATU</a></li>
			<li class="breadcrumb-item active">{{ legend|upper }}</li>
		</ul>
	</div>
</div>
<div class="container-fluid"><br/>
	<div class="row">
		<div class="col-sm-12">
			<div class="card shadow-lg border-info rounded">
				<div class="card-header border-primary">
					<center>
						<h2 class="mb-0">{{legend|upper}}
							<i class="fa fa-arrow-right"></i>
							<a class="btn btn-sm btn-danger" href="{% url 'cont-no-list' %}">Kontratu Seidauk Iha <i class="fa fa-users"></i></a>
						</h2>
					</center>
				</div>
				<div class="card-body">
					
					<table class="table table-sm table-striped " id="example" width="100%" cellspacing="0">
						<thead>
							<tr>
								<th>Nu.</th>
								<th>Naran</th>
								<th>Tipu Kontratu</th>
								<th>Pojisaun</th>
								<th>Data Hahu</th>
								<th>Data Remata</th>
								<th>Status</th>
								<th>#</th>
							</tr>
						</thead>
						<tbody>
						{% for obj in objects %}
							<tr>
								<td>{{ forloop.counter }}</td>
								<td><a href="{% url 'emp-detail' obj.employee.hashed %}" title="Employee Details">{{ obj.employee }}</a></td>
								<td>{{ obj.contract_type }}</td>
								<td>{% if obj.position %}{{ obj.position }}{% else %}{{ obj.category }}{% endif %}</td>
								<td>{{obj.start_date|date:"d-m-Y"}}</td>
								<td>
									{% if obj.end_date %}
									  {{obj.end_date|date:"d-m-Y"}}
									{% else %}
										<span class="badge bg-success text-white"> <i class="fa fa-triangle-exclamation"></i> Undeterminable</span>
									{% endif %}
								</td>
								<td>{% if obj.is_active == True %}Active{% else %}Desactive{% endif %}</td>
								<td>
									<a class="btn btn-sm btn-info" href="{% url 'cont-detail' obj.hashed %}" title="Contract Details">Details <i class="fa fa-eye"></i></a>
								</td>
							</tr>
						{% endfor %}
						</tbody>
					</table>
				</div> <!--end card-body-->
			</div> <!--end card-->
		</div> <!--end col-->
	</div> <!--end row-->
</div>
{% endblock %}
{% block scripts %}
	<script type="text/javascript">
		$(document).ready(function() {
			$('#example').DataTable();
		} );
	</script>
{% endblock %}