
    si                        d Z ddlmZ ddlmZ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 dd
lmZ ddlmZ ddlmZmZmZ ddl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
Dashboard of recruitment
    )Any)CountQ)reverse)method_decorator)gettext_lazy)JobRoleFilter)JobPosition)login_required)HorillaListView)manager_can_enter)CandidateFilterRecruitmentFilterSkillZoneFilter)	CandidateRecruitment	SkillZonedispatch)namezrecruitment.view_recruitment)permc                   x     e Zd ZdZdeddf fdZeZeZ	 e
d      ddf e
d	      d
fgZdZddiZ fdZdZ xZS )SkillZoneStatusListzB
    List view for skill zone status in recruitment dashboard
    kwargsreturnNc                 D    t        |   di | t        d      | _        y )Nzskill-zone-status-dashboard super__init__r   
search_urlselfr   	__class__s     =/var/www/python-projects/worksol/recruitment/cbv/dashboard.pyr   zSkillZoneStatusList.__init__   s     "6"!"?@    z
Skill Zonetitle
get_avatarzNo. of Candidatescandidate_count_displayFzB
                 style="width:150px !important"
                 c                 H    t         |          }|j                  d      }|S )NT)	is_activer   get_querysetfilterr"   querysetr#   s     r$   r,   z SkillZoneStatusList.get_queryset0   s%    7')??T?2r%   zY
                onclick = "window.location.href='{get_skill_zone_url}'"
                )__name__
__module____qualname____doc__r   r   r   modelr   filter_class_columnsbulk_select_optionheader_attrsr,   	row_attrs__classcell__r#   s   @r$   r   r      ss    
A A A E"L	
<'<0	
	!:;G  	 L
Ir%   r   c                   t     e Zd ZdZeZeZdZ e	d      ddf e	d      dfgZ
ddiZ fd	Zd
eddf fdZ xZS )CandidateOnOnboardListzE
    List view for candidate on onboard in recruitment dashboard
    F
Candidatesr   r'   zJob Positionjob_position_idB
                 style="width:100px !important"
                 c                 H    t         |          }|j                  d      }|S )NF)onboarding_stage__isnullr+   r.   s     r$   r,   z#CandidateOnOnboardList.get_querysetR   s%    7')??E?Br%   r   r   Nc                 D    t        |   di | t        d      | _        y )Nzcandidate-on-onboard-dashboardr   r   r!   s     r$   r   zCandidateOnOnboardList.__init__W   s     "6"!"BCr%   )r0   r1   r2   r3   r   r4   r   r5   r8   r6   r7   r9   r,   r   r   r;   r<   s   @r$   r>   r>   :   sq    
 E"L 
<&,/	
>	-.G 	 L
D D D Dr%   r>   c                        e Zd ZdZeZeZdZ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gZdddddddZ fdZdeddf fdZ xZS )CurrentHiringListz@
    List view for hiring in each job position in dashboard
    F
   zJob Positionsjob_positionInitialinitial_countTest
test_count	Interviewinterview_countHiredhired_count	Cancelledcancelled_countzW
                          style = "width:100px !important "
                          zU
                          style = "width:55px !important"
                          zV
                          style = "width:55px !important;"
                          zU
                          style = "width:60px !important"
                          zU
                          style = "width:65px !important"
                          )rH   rJ   rL   rN   rP   rR   c                 "   t         |          }|j                  t        dt	        d            t        dt	        d            t        dt	        d            t        dt	        d            t        dt	        d            	      }|S )
N	candidateinitial)candidate__stage_id__stage_type)r-   test	interviewhired	cancelled)rJ   rL   rN   rP   rR   )r   r,   annotater   r   r.   s     r$   r,   zCurrentHiringList.get_queryset   s    7')$$Ai$P Af$M "Ak$R Ag$N "Ak$R % 
" r%   r   r   Nc                 D    t        |   di | t        d      | _        y )Nz!current-hiring-pipeline-dashboardr   r   r!   s     r$   r   zCurrentHiringList.__init__   s     "6"!"EFr%   )r0   r1   r2   r3   r
   r4   r	   r5   r8   records_per_pager6   r7   r9   r,   r   r   r;   r<   s   @r$   rF   rF   \   s    
 E L 
?	^,	
9'	
6L!	
;*+	
7]#	
;*+G!L**G G G Gr%   rF   c                   r     e Zd ZdZeZeZdZ e	d      df e	d      dfgZ
ddiZ fdZd	ed
df fdZ xZS )OnGoingRecruitmentListzJ
    List view for ongoing recruitment and its managers in  dashboard
    F
Recrutmentr&   ManagersmanagersrA   c                 H    t         |          }|j                  d      }|S )NF)closedr+   r.   s     r$   r,   z#OnGoingRecruitmentList.get_queryset   s%    7')??%?0r%   r   r   Nc                 D    t        |   di | t        d      | _        y )Nzongoing-recruitment-dashboardr   r   r!   s     r$   r   zOnGoingRecruitmentList.__init__   s     "6"!"ABr%   )r0   r1   r2   r3   r   r4   r   r5   r8   r6   r7   r9   r,   r   r   r;   r<   s   @r$   r_   r_      sm    
 E$L 
<'"	
:
#G 	 L
C C C Cr%   r_   N)#r3   typingr   django.db.modelsr   r   django.urlsr   django.utils.decoratorsr   django.utils.translationr   r6   base.filtersr	   base.modelsr
   horilla_views.cbv_methodsr   horilla_views.generic.cbv.viewsr   recruitment.cbv_decoratorsr   recruitment.filtersr   r   r   recruitment.modelsr   r   r   r   r>   rF   r_   r   r%   r$   <module>rr      s)    %  4 6 & # 4 ; 8 S S @ @ .z29:/  3B .z29:D_ D 3D< .z29:?G ?G 3?GD .z29:C_ C 3Cr%   