
    siu                         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 ddlmZ ddlmZmZ dd	lmZmZ  eed
       e ed      d
       G d de                    Z eed
       e ed      d
       G d de                    Zy)z;
This page  handles rotating shift types page in settings.
    )Any)reverse)method_decorator)gettext_lazy)RotatingShiftFilter)RotatingShift)login_requiredpermission_required)HorillaListViewHorillaNavViewdispatch)namezbase.view_rotatingshift)permc                        e Zd ZdZdeddf fdZeZeZ	 e
d      df e
d      d	f e
d
      df e
d      dfgZg dZdZddiZ xZS )RotatingShiftTypeListViewz.
    List view of the employee shift page
    kwargsreturnNc                 r   t        |   di | d| _        t        d      | _        g | _        | j                  j                  j                  d      r| j
                  j                  dddd       | j                  j                  j                  d      r | j
                  j                  d	d
dd       y y )N
shift_viewrotating-shift-listzbase.change_rotatingshiftEditzcreate-outlinea-  
                    class="oh-btn oh-btn--light-bkg w-100"
                    hx-get="{get_update_url}?instance_ids={ordered_ids}"
                    hx-target="#genericModalBody"
                    data-toggle="oh-modal-toggle"
                    data-target="#genericModal"
                    )actioniconattrszbase.delete_rotatingshiftDeleteztrash-outlinea  
                            class="oh-btn oh-btn--danger-outline oh-btn--light-bkg w-100"
                            hx-get="{get_delete_url}?model=base.rotatingshift&pk={pk}"
                            data-toggle="oh-modal-toggle"
                            data-target="#deleteConfirmation"
                            hx-target="#deleteConfirmationBody"
                         )
super__init__view_idr   
search_urlactionsrequestuserhas_permappendselfr   	__class__s     ;/var/www/python-projects/worksol/base/cbv/rotating_shift.pyr   z"RotatingShiftTypeListView.__init__   s    "6" $!"78<<%%&ABLL$,
 <<%%&ABLL&+
 C    Titler   Shift 1shift1Shift 2shift2Additional Shiftsget_additional_shifts))r+   r   )r,   shift1__employee_shift)r.   shift2__employee_shift)r0   r1   zI
                id = "rotatingShiftTr{get_instance_id}"
                z  style="width:200px !important" )__name__
__module____qualname____doc__r   r   r   modelr   filter_class_columnssortby_mapping	row_attrsheader_attrs__classcell__r(   s   @r)   r   r      s    " " "H E&L 
7V	
9x 	
9x 	
	!89	GNI
 	6Lr*   r   c                   N     e Zd ZdZdeddf fdZ ed      Z e       Z	dZ
 xZS )RotatingShiftTypeNavz
    Nav bar
    r   r   Nc                     t        |   di | t        d      | _        | j                  j
                  j                  d      rdt        d       d| _        y y )Nr   zbase.add_rotatingshiftz
                                data-toggle="oh-modal-toggle"
                                data-target="#genericModal"
                                hx-target="#genericModalBody"
                                hx-get="zrotating-shift-createz""
                                r   )r   r   r   r    r"   r#   r$   create_attrsr&   s     r)   r   zRotatingShiftTypeNav.__init__]   sb    "6"!"78<<%%&>?%) *11H)I(J K!	!$D @r*   zRotating Shiftz#listContainer)r4   r5   r6   r7   r   r   r:   	nav_titler   filter_instancesearch_swap_targetr?   r@   s   @r)   rB   rB   V   s6    	$ 	$ 	$ "#I)+O)r*   rB   N)r7   typingr   django.urlsr   django.utils.decoratorsr   django.utils.translationr   r:   base.filtersr   base.modelsr   horilla_views.cbv_methodsr	   r
   horilla_views.generic.cbv.viewsr   r   r   rB   r   r*   r)   <module>rP      s      4 6 , % I K .z2%+DEJW@ @ X 3@F .z2%+DEJW*> * X 3*r*   