agdar/hr/templates/hr/attendance_list.html
Marwan Alwali a788c086ae update
2025-11-02 18:05:50 +03:00

96 lines
4.3 KiB
HTML

{% extends "base.html" %}
{% load i18n static %}
{% block title %}{% trans "Attendance Records" %} - {{ block.super }}{% endblock %}
{% block content %}
<div class="container-fluid">
<div class="d-flex justify-content-between align-items-center mb-4">
<h1 class="h3 mb-0">
<i class="fa fa-clock me-2"></i>{% trans "Attendance Records" %}
</h1>
<div class="btn-group">
<a href="{% url 'hr:attendance-kiosk' %}" class="btn btn-info">
<i class="fa fa-desktop me-1"></i>{% trans "Kiosk" %}
</a>
<a href="{% url 'hr:attendance-create' %}" class="btn btn-primary">
<i class="fa fa-plus me-1"></i>{% trans "New Record" %}
</a>
</div>
</div>
<div class="card">
<div class="card-body">
{% if attendances %}
<div class="table-responsive">
<table class="table table-hover">
<thead>
<tr>
<th>{% trans "Employee" %}</th>
<th>{% trans "Date" %}</th>
<th>{% trans "Check In" %}</th>
<th>{% trans "Check Out" %}</th>
<th>{% trans "Hours" %}</th>
<th>{% trans "Status" %}</th>
<th>{% trans "Actions" %}</th>
</tr>
</thead>
<tbody>
{% for attendance in attendances %}
<tr>
<td>
<a href="{% url 'hr:attendance-detail' attendance.pk %}">
{{ attendance.employee.get_full_name }}
</a>
</td>
<td>{{ attendance.date|date:"Y-m-d" }}</td>
<td>{{ attendance.check_in|time:"H:i"|default:"—" }}</td>
<td>{{ attendance.check_out|time:"H:i"|default:"—" }}</td>
<td>{{ attendance.hours_worked|default:"—" }}</td>
<td>
{% if attendance.status == 'PRESENT' %}
<span class="badge bg-success">{{ attendance.get_status_display }}</span>
{% elif attendance.status == 'LATE' %}
<span class="badge bg-warning">{{ attendance.get_status_display }}</span>
{% elif attendance.status == 'ABSENT' %}
<span class="badge bg-danger">{{ attendance.get_status_display }}</span>
{% else %}
<span class="badge bg-secondary">{{ attendance.get_status_display }}</span>
{% endif %}
</td>
<td>
<div class="btn-group btn-group-sm">
<a href="{% url 'hr:attendance-detail' attendance.pk %}" class="btn btn-outline-primary">
<i class="fa fa-eye"></i>
</a>
<a href="{% url 'hr:attendance-update' attendance.pk %}" class="btn btn-outline-warning">
<i class="fa fa-edit"></i>
</a>
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% if is_paginated %}
{% include "includes/pagination_unified.html" %}
{% endif %}
</div>
{% else %}
<div class="text-center py-5">
<i class="fa fa-clock fa-3x text-muted mb-3"></i>
<p class="text-muted">{% trans "No attendance records found." %}</p>
<a href="{% url 'hr:attendance-create' %}" class="btn btn-primary">
<i class="fa fa-plus me-1"></i>{% trans "Create First Record" %}
</a>
</div>
{% endif %}
</div>
</div>
</div>
{% endblock %}