
.page-header
  %h2
    .icon-pencil
    = Yii::t("app", "Logs")

%table.table.table-condensed
  %thead
    %tr
      %th=t('Name')
      %th=t('Path')
      %th=t('Size')
      %th=t('Levels')
  %tbody
    -foreach($logs as $log)
      %tr
        %td
          -if(file_exists($log->file))
            %a(title="#{t('View')}" href="#{url('debug/ViewAsText',array('filename'=>$log->file))}")
              =$log->filename
            ='('
            %a(title="#{t('Watch')}" href="#{url('debug/WatchLog',array('filename'=>$log->file))}")
              .icon-refresh
            =')'
          -else
            =$log->filename
        %td
          -if(file_exists($log->path))
            %a(href="#{url('debug/fileexplorer',array('path'=>$log->path))}")
              =$log->path
          -else
            =$log->path
        %td
          -if(file_exists($log->file))
            =formatBytes(filesize($log->file))
          -else
            =t('File not found')
        %td
          -if(count($log->levels)>0)
            -foreach($log->levels as $level)
              -if($level == CLogger::LEVEL_TRACE)
                %a(title="LEVEL_TRACE" style="color: green;")
                  .icon-random
              -elseif($level == CLogger::LEVEL_WARNING)
                %a(title="LEVEL_WARNING" style="color: orange;")
                  .icon-warning-sign
              -elseif($level == CLogger::LEVEL_ERROR)
                %a(title="LEVEL_ERROR" style="color: red;")
                  .icon-exclamation-sign
              -elseif($level == CLogger::LEVEL_INFO)
                %a(title="LEVEL_INFO" style="color: blue;")
                  .icon-info-sign
              -elseif($level == CLogger::LEVEL_PROFILE)
                %a(title="LEVEL_PROFILE" style="color: violet;")
                  .icon-bar-chart
              -else
                =$level

%form
  =t("Filters:")
  %input(type="text" name="filters" value="#{$filters}")