- $canEdit = $this->canEdit()

#service-page
  - $user = User::model()->findByPk(Yii::app()->user->id)

  .page-header
    %h2= Yii::t("app", "Tasks")

  #services-summary.well
    - $this->renderPartial("_servicesSummary", get_defined_vars())
  .alert.alert-info
    %span(style="padding-right: 10px;")
      =t("Available Filters")
    %span
      - if($canEdit)
        %button.btn#release-all(data-confirm-text="#{Yii::t('app', 'Confirm?')}")
          = Yii::t("app", "Release All Tasks")

      - $bfilter = false;
      - if(user()->checkAccess('service_can_filter_only_with_events'))
        %a.btn(href="service?onlyWithEvents=1")=t('Only With Events')
        - $bfilter = true;  

      - if(user()->checkAccess('service_can_filter_mine'))
        %a.btn(href="service?mine=1")=t('In Charge To Me')      
        - $bfilter = true;  

      - if(user()->checkAccess('service_can_filter_to_be_validated') && !paramdeep('report','byWorkPeriod'))
        %a.btn(href="service?tobevalidated=1")=t('To Be Validated')
        - $bfilter = true; 


      - if(user()->checkAccess('service_can_filter_validating_all')  && !paramdeep('report','byWorkPeriod'))
        %a.btn(href="service?validating_all=1")=t('Validating')
        - $bfilter = true;  
      - else if(user()->checkAccess('service_can_filter_validating')  && !paramdeep('report','byWorkPeriod'))
        %a.btn(href="service?validating=1")=t('Validating')
        - $bfilter = true; 

      - if(user()->checkAccess('service_can_filter_exported_all') && !paramdeep('report','byWorkPeriod'))
        %a.btn(href="service?exported_all=1")=t('Exported')
        - $bfilter = true;        
      - else if(user()->checkAccess('service_can_filter_exported') && !paramdeep('report','byWorkPeriod'))
        %a.btn(href="service?exported=1")=t('Exported')      
        - $bfilter = true;       

      - if($bfilter)
        %a.btn(href="service?allServices")=t('All')      
        %a.btn(href="service")=t('Validable')      
     
      

  #services-partial(data-behavior="SlidePagination" style="padding-bottom: 40px;")
    - $this->renderPartial('_servicesTable', get_defined_vars())

  #modal-report-confirm.modal.hide.fade