%h1
  ='Archived'
  %a(href="#{url('debug/usertrackingindex')}")='user tracking'
  ='files'

%hr

%table.table.table-condensed
  %thead
    %tr
      %th='Filename'
      %th='Size'
      %th='Creation Date'
      %th='Last Write Date'
      %th='Actions'
  %tbody
  -$fileCounter = 0
  -foreach($dir as $file)
    -if($file->isFile())
      -$fileCounter++
      %tr
        %td=$file->getFilename()
        %td=formatBytes($file->getSize())
        %td=new DateTimeEx($dir->getCTime())
        %td=new DateTimeEx($dir->getMTime())
        %td
          -if(user()->checkAccess('user_tracking_archive_download'))
            %a.icon-download(href="#{url('debug/UserTrackingArchiveDownload', array('filename'=>$file->getFilename()))}")
          -if(user()->checkAccess('user_tracking_archive_delete'))
            %a.icon-trash(href="#{url('debug/UserTrackingArchiveDelete', array('filename'=>$file->getFilename()))}" onclick="return confirm('Delete archive?');")
  -if( $fileCounter <= 0 )
    %tr
      %td(colspan=5)
        %center
          %b='Empty'
    %tr
      %td(colspan=5)
