[UPDT] BASE: Formatted pages and removed toggle form

This commit is contained in:
Horilla
2025-10-22 15:14:36 +05:30
parent 2ab869d7a4
commit d0f632a9c0
4 changed files with 10 additions and 41 deletions

View File

@@ -6,7 +6,6 @@ from typing import Any
from django.contrib import messages
from django.http import HttpResponse
from django.middleware.csrf import get_token
from django.shortcuts import render
from django.urls import reverse
from django.utils.decorators import method_decorator
@@ -15,7 +14,6 @@ from django.utils.translation import gettext_lazy as _
from base.filters import DepartmentViewFilter
from base.forms import DepartmentForm
from base.models import Department
from horilla.horilla_middlewares import _thread_locals
from horilla_views.cbv_methods import login_required, permission_required
from horilla_views.generic.cbv.views import (
HorillaFormView,
@@ -33,6 +31,7 @@ class DepartmentListView(HorillaListView):
model = Department
filter_class = DepartmentViewFilter
show_toggle_form = False
def __init__(self, **kwargs: Any) -> None:
super().__init__(**kwargs)
@@ -68,20 +67,7 @@ class DepartmentListView(HorillaListView):
}
)
# <button
# class="oh-btn oh-btn--danger-outline oh-btn--light-bkg w-100"
# title="{% trans 'Remove' %}"
# hx-get="{% url 'generic-delete' %}?model=base.Department&pk={{dep.id}}"
# data-toggle="oh-modal-toggle"
# data-target="#deleteConfirmation"
# hx-target="#deleteConfirmationBody"
# >
# <ion-icon name="trash-outline"></ion-icon>
# </button>
row_attrs = """
id="departmentTr{get_delete_instance}"
"""
row_attrs = """ id="departmentTr{get_delete_instance}" """
columns = [
(_("Department"), "department"),
@@ -90,11 +76,6 @@ class DepartmentListView(HorillaListView):
(_("Department"), "department"),
]
header_attrs = {
"department": """ style="width:300px !important" """,
"action": """ style="width:180px !important" """,
}
records_per_page = 7

View File

@@ -24,7 +24,6 @@ class EmployeeShiftListView(HorillaListView):
def __init__(self, **kwargs: Any) -> None:
super().__init__(**kwargs)
# self.action_method = "actions_col"
self.view_id = "shift_view"
self.search_url = reverse("employee-shift-list")
self.actions = []
@@ -59,6 +58,7 @@ class EmployeeShiftListView(HorillaListView):
model = EmployeeShift
filter_class = EmployeeShiftFilter
show_toggle_form = False
bulk_update_fields = [
"weekly_full_time",
@@ -67,19 +67,13 @@ class EmployeeShiftListView(HorillaListView):
columns = [
(_("Shift"), "employee_shift"),
(_("Weekly Full Time"), "weekly_full_time"),
(_("Full Time"), "full_time"),
]
sortby_mapping = [
("Shift", "employee_shift"),
("Weekly Full Time", "weekly_full_time"),
("Full Time", "full_time"),
]
row_attrs = """
id = "shiftTr{get_instance_id}"
"""
row_attrs = """ id = "shiftTr{get_instance_id}" """
@method_decorator(login_required, name="dispatch")
@@ -100,6 +94,6 @@ class EmployeeShiftNav(HorillaNavView):
hx-get="{reverse('employee-shift-create-view')}"
"""
nav_title = _("Shift")
nav_title = _("Employee Shift")
filter_instance = EmployeeShiftFilter()
search_swap_target = "#listContainer"

View File

@@ -64,19 +64,14 @@ class EmployeeTypeListView(HorillaListView):
model = EmployeeType
filter_class = EmployeeTypeFilter
show_toggle_form = False
columns = [
(_("Employee Type"), "employee_type"),
]
header_attrs = {
"employee_type": """
style="width:400px !important;"
"""
}
header_attrs = {"employee_type": """ style="width:400px !important;" """}
row_attrs = """
id = "employeeTypeTr{get_instance_id}"
"""
row_attrs = """ id = "employeeTypeTr{get_instance_id}" """
@method_decorator(login_required, name="dispatch")

View File

@@ -57,14 +57,13 @@ class WorkTypeList(HorillaListView):
model = WorkType
filter_class = WorkTypeFilter
show_toggle_form = False
columns = [
(_("Work Type"), "work_type"),
]
row_attrs = """
id="workTypeTr{get_delete_instance}"
"""
row_attrs = """ id="workTypeTr{get_delete_instance}" """
header_attrs = {
"work_type": """ style="width:300px !important" """,