
    sin                        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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 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 is handling the cbv methods of asset history page
    )Any)reverse)method_decorator)gettext_lazy)AssetHistoryFilter)AssetAssignment)login_requiredpermission_required)HorillaDetailedViewHorillaListViewHorillaNavViewTemplateViewdispatch)namezasset.view_assetassignmentc                       e Zd ZdZdZy)AssetHistoryViewz
    for page view
    z)cbv/asset_history/asset_history_home.htmlN)__name__
__module____qualname____doc__template_name     ;/var/www/python-projects/worksol/asset/cbv/asset_history.pyr   r      s     @Mr   r   c                        e Zd ZdZeZeZdeddf fdZ	 e
d      ddf e
d	      d
f e
d      df e
d      df e
d      dfgZdZg dZdZ xZS )AssetHistorylistViewz
    list view
    kwargsreturnNc                 D    t        |   di | t        d      | _        y Nzasset-history-listr   super__init__r   
search_urlselfr   	__class__s     r   r#   zAssetHistorylistView.__init__*        "6"!"67r   Assetasset_id__asset_name
get_avatarEmployeeassigned_to_employee_idAssigned Dateassigned_dateReturned Datereturn_datezReturn Statusreturn_status   ))r)   r*   r+   )r,   r-   )r.   r/   )r0   r1   z
                hx-get='{asset_detail_view}?instance_ids={ordered_ids}'
                hx-target="#genericModalBody"
                data-target="#genericModal"
                data-toggle="oh-modal-toggle"
                )r   r   r   r   r   filter_classr   modelr   r#   _columnsrecords_per_pagesortby_mapping	row_attrs__classcell__r'   s   @r   r   r       s     &LE8 8 8
 
7+\:	
:12	
?	_-	
?	]+	
?	_-G NIr   r   c                        e Zd ZdZdeddf fdZ ed      ZdZdZ	 e
       Zd	Zd
 ed      fd ed      fd ed      fd ed      fgZ xZS )AssetHistoryNavViewz
    navbar
    r   r   Nc                 D    t        |   di | t        d      | _        y r    r!   r%   s     r   r#   zAssetHistoryNavView.__init__N   r(   r   zAsset Historyz+cbv/asset_history/asset_history_filter.htmlformz#listContainerr*   r)   r-   r,   r/   r.   r1   r0   )r   r   r   r   r   r#   r6   	nav_titlefilter_body_templatefilter_form_context_namer   filter_instancesearch_swap_targetgroup_by_fieldsr;   r<   s   @r   r>   r>   G   s|    8 8 8 /"IH%(*O) 
 7,	"AjM2	!O,-	/*+	Or   r>   c            
           e Zd ZdZeZ ed      ZddddZ ed      df ed	      d
f ed      df ed      df ed      df ed      df ed      ddf ed      ddfgZ	y)AssetHistoryDetailViewz!
    detail view of the page
    zAsset Detailsasset_idasset_id__asset_category_id#assigned_to_employee_id__get_avatar)titlesubtitleavatarzAllocated Userr-   zReturned Statusr2   zAllocated Dater/   r0   r1   r)   zReturn Descriptionreturn_conditionzAssign Condition Imagesassign_condition_imgTzReturn Condition Imagesreturn_condition_imgN)
r   r   r   r   r   r5   r6   rL   headerbodyr   r   r   rH   rH   `   s     EoE17F 
	78	
	/	
	o.	
?	]+	
7Z 	
	 "45	
$	%'=tD	
$	%'=tD	Dr   rH   N)r   typingr   django.urlsr   django.utils.decoratorsr   django.utils.translationr   r6   asset.filtersr   asset.modelsr   horilla_views.cbv_methodsr	   r
   horilla_views.generic.cbv.viewsr   r   r   r   r   r   r>   rH   r   r   r   <module>r\      s     4 6 , ( I  .z2%&BC*U@| @ V 3@ .z2%&BC*U"? " V 3"J .z2%&BC*U.  V 3. .z2%&BC*U0  V 3r   