
    si	                         d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
mZ ddlmZmZ ddlmZ  G d	 d
e      Z G d de      Z ej&                  dej)                         ddg       y)z7
This page handles the cbv methods for resignation tab
    )Any)reverse)method_decorator)EmployeeProfileView)check_feature_enabledlogin_required)ResignationLetterDetailViewResignationListView)OffboardingGeneralSettingc                   v     e Zd ZdZdZdeddf fdZdZ ee	d	       fd
       Z
def fdZ fdZdZ xZS )ResignationTabViewz1
    List view of resignation Tab in profile
       kwargsreturnNc                     t        |   di | d | _        d| _        | j                  j
                  j                  j                  d      }t        dd|i      | _	        y )Nzresignation-containerpkzindividual-resignation-tab-list)r    )
super__init__action_methodview_idrequestresolver_matchr   getr   
search_url)selfr   r   	__class__s      C/var/www/python-projects/worksol/offboarding/cbv/resignation_tab.pyr   zResignationTabView.__init__   sV    "6"!.\\((//33D9!"CTSUJW    z$cbv/resignation/resignation_tab.htmldispatchnamec                 *    t        t        | 
  |i |S N)r   r
   r    r   argsr   r   s      r   r    zResignationTabView.dispatch!   s    ($8$I&IIr   c                 f    t        |   di |}| j                  j                  d      }||d<   |S )Nr   employeer   )r   get_context_datar   r   )r   r   contextr   r   s       r   r)   z#ResignationTabView.get_context_data%   s6    '*4V4[[__T" 
r   c                 ~    t         |          }| j                  j                  d      }|j	                  |      }|S )Nr   )employee_id)r   get_querysetr   r   filter)r   querysetr   r   s      r   r-   zResignationTabView.get_queryset+   s7    7')[[__T"??r?2r   z
                hx-get='{get_detail_tab_url}?instance_ids={ordered_ids}'
                hx-target="#genericModalBody"
                data-target="#genericModal"
                data-toggle="oh-modal-toggle"
                )__name__
__module____qualname____doc__records_per_pager   r   template_namer   r   r    r)   r-   	row_attrs__classcell__r   s   @r   r   r      s`     X X X ;Mn:6J 7J Ir   r   c                   P     e Zd ZdZ eed       fd       Zdeddf fdZ xZ	S )	ResignationTabDetailViewz3
    Detail view of resignation tab in profile
    r    r!   c                 *    t        t        | 
  |i |S r$   )r   r	   r    r%   s      r   r    z!ResignationTabDetailView.dispatch>   s    0$@$Q&QQr   r   r   Nc                 2    t        |   di | d | _        y )Nr   )r   r   r   )r   r   r   s     r   r   z!ResignationTabDetailView.__init__B   s    "6"!r   )
r0   r1   r2   r3   r   r   r    r   r   r7   r8   s   @r   r:   r:   9   s=     n:6R 7R" " " "r   r:   Resignationz7offboarding.cbv.accessibility.resignation_accessibility)titleviewaccessibility)tabsN)r3   typingr   django.urlsr   django.utils.decoratorsr   employee.cbv.employee_profiler   horilla_views.cbv_methodsr   r   offboarding.cbv.resignationr	   r
   offboarding.modelsr   r   r:   add_tabas_viewr   r   r   <module>rK      sm      4 = K X 8%, %P": "     #&..0V	

r   