diff --git a/core/__pycache__/urls.cpython-311.pyc b/core/__pycache__/urls.cpython-311.pyc index ee499ae..93ff41b 100644 Binary files a/core/__pycache__/urls.cpython-311.pyc and b/core/__pycache__/urls.cpython-311.pyc differ diff --git a/core/__pycache__/views.cpython-311.pyc b/core/__pycache__/views.cpython-311.pyc index ee430b6..218b2cc 100644 Binary files a/core/__pycache__/views.cpython-311.pyc and b/core/__pycache__/views.cpython-311.pyc differ diff --git a/core/templates/core/settings.html b/core/templates/core/settings.html index f62b8d0..676c63a 100644 --- a/core/templates/core/settings.html +++ b/core/templates/core/settings.html @@ -50,6 +50,12 @@ {% trans "WhatsApp Gateway" %} + +
@@ -625,6 +631,50 @@
+ +
+
+
+
+
+
{% trans "Backup Database" %}
+
+
+

{% trans "Download a complete SQL dump of your database. Keep this file safe." %}

+ + {% trans "Download Backup" %} + +
+
+
+ +
+
+
+
{% trans "Restore Database" %}
+
+
+
+ + {% trans "Warning:" %} {% trans "This will overwrite all current data. This action cannot be undone." %} +
+
+ {% csrf_token %} +
+ + +
+ +
+
+
+
+
+
+ + -{% endblock %} +{% endblock %} \ No newline at end of file diff --git a/hr/templates/hr/employee_list.html b/hr/templates/hr/employee_list.html index 893ee45..75a0621 100644 --- a/hr/templates/hr/employee_list.html +++ b/hr/templates/hr/employee_list.html @@ -17,6 +17,7 @@ {% trans "Name" %} + {% trans "Biometric ID" %} {% trans "Department" %} {% trans "Position" %} {% trans "Email" %} @@ -33,6 +34,7 @@ {{ employee.first_name }} {{ employee.last_name }} + {{ employee.biometric_id|default:"-" }} {{ employee.department.name_en }} / {{ employee.department.name_ar }} {{ employee.job_position.title_en }} / {{ employee.job_position.title_ar }} {{ employee.email }} @@ -50,7 +52,7 @@ {% empty %} - {% trans "No employees found." %} + {% trans "No employees found." %} {% endfor %} @@ -59,4 +61,4 @@ -{% endblock %} +{% endblock %} \ No newline at end of file diff --git a/hr/views.py b/hr/views.py index ea4703d..0ff4346 100644 --- a/hr/views.py +++ b/hr/views.py @@ -3,6 +3,7 @@ from django.contrib.auth.mixins import LoginRequiredMixin from django.urls import reverse_lazy from django.utils.translation import gettext_lazy as _ from .models import Employee, Department, Attendance, LeaveRequest, JobPosition, BiometricDevice +from .forms import EmployeeForm from django.db.models import Count from django.shortcuts import get_object_or_404, redirect from django.contrib import messages @@ -27,7 +28,7 @@ class EmployeeListView(LoginRequiredMixin, ListView): class EmployeeCreateView(LoginRequiredMixin, CreateView): model = Employee - fields = '__all__' + form_class = EmployeeForm template_name = 'hr/employee_form.html' success_url = reverse_lazy('hr:employee_list') @@ -38,7 +39,7 @@ class EmployeeCreateView(LoginRequiredMixin, CreateView): class EmployeeUpdateView(LoginRequiredMixin, UpdateView): model = Employee - fields = '__all__' + form_class = EmployeeForm template_name = 'hr/employee_form.html' success_url = reverse_lazy('hr:employee_list') @@ -141,4 +142,4 @@ def sync_device_logs(request, pk): else: messages.success(request, _("Sync Successful! Fetched %(total)s records, %(new)s new.") % {'total': result['total'], 'new': result['new']}) - return redirect('hr:device_list') + return redirect('hr:device_list') \ No newline at end of file