#administration-page
  - $user = Yii::app()->user
  - $app = Yii::app()
  
  .page-header
    %h2
      %li.icon-cog
      = Yii::t("app", "Administration")
  %span8
    %table
      %tr
        %td
          .span3
            .admin-menu-container.span3
              .admin-menu-title
                =t("Gates")
              %section
                %span.title
                  %a(href="#{Yii::app()->createUrl('gateSets/index')}")
                    = Yii::t("app", "Gate Sets")
              - if($user->checkAccess('manage_gates'))  
                %section
                  %span.title
                    %a(href="#{Yii::app()->createUrl('gateGroup/index')}")
                      = Yii::t("app", "Gate Groups")
                %section
                  %span.title
                    %a(href="#{Yii::app()->createUrl('gate/index')}")
                      = Yii::t("app", "Gates")
              - else                              
                %section
                  %span.title
                    = Yii::t("app", "No  availabe action")

        %td
          .span3
            .admin-menu-container.span3
              .admin-menu-title
                =t("Users")
              - if($user->checkAccess('manage_auth'))
                %section
                  %span.title
                    %a(href="#{$app->createUrl('auth')}")= Yii::t('app', 'Assignments')
              - if($user->checkAccess('manage_users'))
                %section
                  %span.title
                    %a(href="#{$app->createUrl('user')}")= Yii::t('app', 'Manage users')
              -  if(!$user->checkAccess('manage_users') && !$user->checkAccess('manage_auth'))                              
                %section
                  %span.title
                    = Yii::t("app", "No  availabe action")
        %td
          .span3
            .admin-menu-container.span3
              .admin-menu-title
                =t("Time Schedule")
              - if($user->checkAccess('manage_special_day'))
                %section
                  %span.title
                    %a(href="#{$app->createUrl('specialDay')}")= Yii::t('app', 'Manage special days')
              - if($user->checkAccess('manage_time_schedule'))
                %section
                  %span.title
                    %a(href="#{$app->createUrl('timeSchedule')}")= Yii::t('app', 'Manage time schedule')                    
              - if(!$user->checkAccess('manage_special_day') && !$user->checkAccess('manage_time_schedule'))                              
                %section
                  %span.title
                    = Yii::t("app", "No  availabe action")
                    
      %tr
        %td
          .span3
            .admin-menu-container.span3
              .admin-menu-title
                =t("Tasks")
              - if($user->checkAccess('manage_tasks'))  
                %section
                  %span.title
                    %a(href="#{Yii::app()->createUrl('runSchedule/admin')}")
                      = t('Manage Run Schedules')
              - else                              
                %section
                  %span.title
                    = Yii::t("app", "No  availabe action")
                    
        %td
          .span3
            .admin-menu-container.span3
              .admin-menu-title
                =t("Behaviors")
              - $visibleItemsCount = 0
              - if($user->checkAccess('gate_behavior_management'))
                -$visibleItemsCount++
                %section
                  %span.title
                    %a(href="#{Yii::app()->createUrl('gateBehavior/admin')}")
                      = t('Manage Gate Behaviors')
              - if($user->checkAccess('behavior_management'))
                -$visibleItemsCount++
                %section
                  %span.title
                    %a(href="#{Yii::app()->createUrl('behavior/admin')}")
                      = t('Manage Behaviors')
              - if($visibleItemsCount <= 0)
                %section
                  %span.title
                    = Yii::t("app", "No  availabe action")
        %td
          -if(paramdeep('adminPanel','showMeanSpeed'))
            .span3
              .admin-menu-container.span3
                .admin-menu-title
                  =t("Mean speed")
                - if($user->checkAccess('section_management'))  
                  %section
                    %span.title
                      %a(href="#{Yii::app()->createUrl('section/admin')}")
                        = t('Manage Sections')
                  %section
                    %span.title
                      %a(href="#{Yii::app()->createUrl('crossingTime/admin')}")
                        = t('Manage Crossing Times')
                - else                              
                  %section
                    %span.title
                      = Yii::t("app", "No  availabe action")
      %tr
        %td
          .span3
            .admin-menu-container.span3
              .admin-menu-title
                =t("Violations")
              - $visibleItemsCount = 0
              - if($user->checkAccess('violation_document_manage'))
                - $visibleItemsCount++
                %section
                  %span.title
                    %a(href="#{Yii::app()->createUrl('ViolationDocument/admin')}")
                      = t('Violations documents')
              - if($user->checkAccess('violations_queued'))
                - $visibleItemsCount++
                %section
                  %span.title
                    %a(href="#{Yii::app()->createUrl('event/queued')}")
                      = t('View queued violations')
              - if($user->checkAccess('export_history_report'))
                - $visibleItemsCount++
                %section
                  %span.title
                    %a(href="#{Yii::app()->createUrl('ExportRegistration/admin')}")
                      = t('Export history')        
              - if($visibleItemsCount == 0)
                %section
                  %span.title
                    = Yii::t("app", "No  availabe action")
        -if(paramdeep('adminPanel','showPlateAuthProfile'))
          %td
            .span3
              .admin-menu-container.span3
                .admin-menu-title
                  =t("Plate authorizations")
                - $visibleItemsCount = 0
                - if($user->checkAccess('plateauthinsertprofile_management'))
                  - $visibleItemsCount++
                  %section
                    %span.title
                      %a(href="#{Yii::app()->createUrl('PlateAuthInsertProfile/admin')}")
                        = t('Manage Plate Auth Insert Profiles')
                - if($user->checkAccess('plate_auth_tabula_rasa'))
                  - $visibleItemsCount++
                  %section
                    %span.title
                      %a(href="#{Yii::app()->createUrl('PlateAuthorization/tabularasa')}")
                        = t('Tabula Rasa')
                - if($visibleItemsCount == 0)
                  %section
                    %span.title
                      = Yii::t("app", "No  availabe action")
        %td
          .span3
            .admin-menu-container.span3
              .admin-menu-title
                =t("Violations")
              - $visibleItemsCount = 0
              - if($user->checkAccess('violation_code_manage'))
                - $visibleItemsCount++
                %section
                  %span.title
                    %a(href="#{Yii::app()->createUrl('violationcode/admin')}")
                      = t('Violation codes')
              - if($user->checkAccess('custom_plate_type_manage'))
                - $visibleItemsCount++
                %section
                  %span.title
                    %a(href="#{Yii::app()->createUrl('CustomPlateType/admin')}")
                      = t('Custom Plate Type')
              - if($user->checkAccess('custom_property_type_manage'))
                - $visibleItemsCount++
                %section
                  %span.title
                    %a(href="#{Yii::app()->createUrl('CustomPropertyType/admin')}")
                      = t('Custom Property Type')
              - if($visibleItemsCount == 0)
                %section
                  %span.title
                    = Yii::t("app", "No  availabe action")
      %tr
        %td
          .span3
            .admin-menu-container.span3
              .admin-menu-title
                =t("System")
              - if($user->checkAccess('system_management'))  
                %section
                  %span.title
                    %a(href="#{Yii::app()->createUrl('system/config')}")
                      = t('View sytem configuration')
                %section
                  %span.title
                    %a(href="#{Yii::app()->createUrl('system/configExport')}")
                      = t('Export sytem configuration')
                %section
                  %span.title
                    %a(href="#{Yii::app()->createUrl('system/configImport')}")
                      = t('Import sytem configuration')                
                %section
                  %span.title
                    %a(href="#{Yii::app()->createUrl('system/configRestore')}")
                      = t('Restore sytem configuration')
              - else                              
                %section
                  %span.title
                    = Yii::t("app", "No  availabe action")
      - if((paramdeep('adminPanel','showDebug') && DebugController::canDebug()) || DebugController::isInDebugMode() || YII_DEBUG)  
        %tr
          %td
            .span3
              .admin-menu-container.span3
                .admin-menu-title
                  .icon-bug
                  =t("Debug")
                -if(!DebugController::isInDebugMode())
                  %section
                    %span.title
                      %a(href="#{Yii::app()->createUrl('debug/EnableDebug')}")
                        .icon-signin
                        = t('Enter Debug Mode')
                -else
                  %section
                    %span.title
                      %a(href="#{Yii::app()->createUrl('debug/index')}")
                        .icon-bug
                        = t("Debug")
                  %section
                    %span.title
                      %a(href="#{Yii::app()->createUrl('debug/DisableDebug')}")
                        .icon-signout
                        = t('Leave Debug Mode')
                
                      