From 04f1a9fc7614b56122ec53c6ef7b44ba4d1c5b34 Mon Sep 17 00:00:00 2001 From: Horilla Date: Fri, 24 Oct 2025 12:20:00 +0530 Subject: [PATCH] [UPDT] EMPLOYEE: Updated the employee column width in disciplinary action list view and formated the code --- employee/cbv/disciplinary_actions.py | 52 +++++++++++++--------------- 1 file changed, 24 insertions(+), 28 deletions(-) diff --git a/employee/cbv/disciplinary_actions.py b/employee/cbv/disciplinary_actions.py index 9f56ece64..814cf0bef 100644 --- a/employee/cbv/disciplinary_actions.py +++ b/employee/cbv/disciplinary_actions.py @@ -43,6 +43,30 @@ class DisciplinaryActionsList(HorillaListView): List view of disciplinary actions """ + columns = [ + (_("Employee"), "employee_column"), + (_("Action Taken"), "action_taken_col"), + (_("Login Block"), "block_option_col"), + (_("Action Date"), "action_date_col"), + (_("Attachments"), "attachments_col"), + (_("Description"), "description"), + ] + + header_attrs = {"employee_column": 'style="width:300px !important;"'} + + sortby_mapping = [ + ("Action Taken", "action_taken_col"), + ("Action Date", "action_date_col"), + ] + + row_attrs = """ + class ="oh-sticky-table__tr oh-permission-table__tr oh-permission-table--collapsed" + hx-get='{dis_action_detail_view}?instance_ids={ordered_ids}' + hx-target="#genericModalBody" + data-target="#genericModal" + data-toggle="oh-modal-toggle" + """ + model = DisciplinaryAction filter_class = DisciplinaryActionFilter @@ -72,34 +96,6 @@ class DisciplinaryActionsList(HorillaListView): ): self.action_method = "actions" - columns = [ - (_("Employee"), "employee_column"), - (_("Action Taken"), "action_taken_col"), - (_("Login Block"), "block_option_col"), - (_("Action Date"), "action_date_col"), - (_("Attachments"), "attachments_col"), - (_("Description"), "description"), - ] - - header_attrs = { - "employee_column": """ - style="width:200px !important;" - """ - } - - sortby_mapping = [ - ("Action Taken", "action_taken_col"), - ("Action Date", "action_date_col"), - ] - - row_attrs = """ - class ="oh-sticky-table__tr oh-permission-table__tr oh-permission-table--collapsed" - hx-get='{dis_action_detail_view}?instance_ids={ordered_ids}' - hx-target="#genericModalBody" - data-target="#genericModal" - data-toggle="oh-modal-toggle" - """ - @method_decorator(login_required, name="dispatch") class DisciplinaryActionsNav(HorillaNavView):