<commit_before>
<?php 
$showListing = true;

if (sizeof($folders) > 0) {
  $showListing = true;
} else {
  if (sizeof($files) > sizeof($gallery_files)) {
    $showListing = true;
  } else {
    $showListing = false;
  }
}

if ($showListing) { ?>
<table class="file_folder_listing">
<thead>
  <tr>
    <td>
      <img src='<?php echo view::get_view_url() ?>/images/no_icon.gif' width='30' height='14' border='0' />
    </td>
    <td class="filename">
      <a href="?sort=filename">filename</a>
    </td>
    <td class="filesize">
      <a href="?sort=size">size</a>
    </td>
    <td class="filedate">
      <a href="?sort=date">date</a>
    </td>
    <td class="filekind">
      <a href="?sort=kind">kind</a>
    </td>
    <td class="filecomment">
      comment
    </td>
  </tr>
</thead>

<tbody>
<?php 
$new_updated_start = $this->filebrowser->get_updated_since_time();
foreach ($folders as $folder): 
    $kind = $this->filebrowser->get_kind($folder->name);
    $icon_file = "i_dir";

    $url = "";
	  switch ($kind) {
			case "site" :
			  $url = "/directory".$this->filebrowser->get_link($folder->name)."/index.html";
        break;

			case "pages" :
  			  $url = "/directory".$this->filebrowser->get_link($folder->name);
          $icon_file = "i_pages";
  			  break;

			case "numbers" :
  			  $url = "/directory".$this->filebrowser->get_link($folder->name);
          $icon_file = "i_numbers";
  			  break;

			case "key" :
  			  $url = "/directory".$this->filebrowser->get_link($folder->name);
          $icon_file = "i_key";
  			  break;
        
			default:
          $url = "".$this->filebrowser->get_link($folder->name);
        break;  		
    }	
?>
  <tr>
    <td>
      <?php
        //different folder based on the access
        $new = "";
        $updated = "";
         
        if ($folder->is_restricted()) {
          $icon_file = "i_dir";
          if ($folder->have_access($this->auth->get_user())) {
            $icon_file = "i_dir_unlocked";
          } else {
            $icon_file = "i_dir_locked";
          }
        } else {
          
          if (false && $folder->stats['ctime'] > $new_updated_start) {
              $new = "_new";
          } else if ($folder->stats['mtime'] > $new_updated_start) {
              $updated = "_up";
          }
        }
        
        
        $thumbnail = view::get_view_url()."/images/".$icon_file.$new.$updated.".gif";        
        
      ?>
      <a href="<?php echo $url ?>"><img src='<?php echo $thumbnail ?>' width='30' height='14' border='0' /></a>
    </td>
    <td class="filename">
      <a href="<?php echo $url ?>"><?php echo $folder->get_display_name() ?></a>
    </td>
    <td class="filesize"><commit_msg>adding target for site opens<commit_after>
<?php 
$showListing = true;

if (sizeof($folders) > 0) {
  $showListing = true;
} else {
  if (sizeof($files) > sizeof($gallery_files)) {
    $showListing = true;
  } else {
    $showListing = false;
  }
}

if ($showListing) { ?>
<table class="file_folder_listing">
<thead>
  <tr>
    <td>
      <img src='<?php echo view::get_view_url() ?>/images/no_icon.gif' width='30' height='14' border='0' />
    </td>
    <td class="filename">
      <a href="?sort=filename">filename</a>
    </td>
    <td class="filesize">
      <a href="?sort=size">size</a>
    </td>
    <td class="filedate">
      <a href="?sort=date">date</a>
    </td>
    <td class="filekind">
      <a href="?sort=kind">kind</a>
    </td>
    <td class="filecomment">
      comment
    </td>
  </tr>
</thead>

<tbody>
<?php 
$new_updated_start = $this->filebrowser->get_updated_since_time();
foreach ($folders as $folder): 
    $target = "";
    $kind = $this->filebrowser->get_kind($folder->name);
    $icon_file = "i_dir";

    $url = "";
	  switch ($kind) {
			case "site" :
			  $url = "/directory".$this->filebrowser->get_link($folder->name)."/index.html";
			  $target = "_blank";
        break;

			case "pages" :
  			  $url = "/directory".$this->filebrowser->get_link($folder->name);
          $icon_file = "i_pages";
  			  break;

			case "numbers" :
  			  $url = "/directory".$this->filebrowser->get_link($folder->name);
          $icon_file = "i_numbers";
  			  break;

			case "key" :
  			  $url = "/directory".$this->filebrowser->get_link($folder->name);
          $icon_file = "i_key";
  			  break;
        
			default:
          $url = "".$this->filebrowser->get_link($folder->name);
        break;  		
    }	
?>
  <tr>
    <td>
      <?php
        //different folder based on the access
        $new = "";
        $updated = "";
         
        if ($folder->is_restricted()) {
          $icon_file = "i_dir";
          if ($folder->have_access($this->auth->get_user())) {
            $icon_file = "i_dir_unlocked";
          } else {
            $icon_file = "i_dir_locked";
          }
        } else {
          
          if (false && $folder->stats['ctime'] > $new_updated_start) {
              $new = "_new";
          } else if ($folder->stats['mtime'] > $new_updated_start) {
              $updated = "_up";
          }
        }
        
        
        $thumbnail = view::get_view_url()."/images/".$icon_file.$new.$updated.".gif";        
        
      ?>
      <a <?php if ($target <> "") print "target='$target'" ?> href="<?php echo $url ?>"><img src='<?php echo $thumbnail ?>' width='30' height='14' border='0' /></a>
    </td>
    <td class="filename">
      <a href="<?php echo $url ?>"><?php echo $folder->get_display_name() ?></a>
    </td>
    <td class="filesize">
{'fraction_non_alphanumeric': 0.19971030237189932, 'fraction_numerical': 0.003983342386384212, 'mean_word_length': 2.2116279069767444, 'pattern_counts': {'":': 0, '<': 97, '<?xml version=': 0, '>': 159, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2550100', 'n_tokens_mistral': 2017, 'n_tokens_neox': 1922, 'n_words': 347}