<commit_before><?php
if (plugin_active('files')) { 
$file = $attachment->getObject();
if (!$file) {
?>
  <div class="fileAttachment">
    <div class="fileIcon"><img src="<?php echo get_image_url('filetypes/unknown.png'); ?>" /></div>
    <div class="fileInfo">
      <span class="fileDescription"><?php echo $attachment->getText() ?>:</span>
      <span class="fileName"><?php echo lang('edit project to select file'); ?></span>
    </div>
    <div class="clear"></div>
  </div>

<?php 
} else {
  if ($file->canView(logged_user())) {
?>
  <div class="fileAttachment">
<?php if ($file->isPrivate()) { ?>
    <div class="private" title="<?php echo lang('private file') ?>"><span><?php echo lang('private file') ?></span></div>
<?php } // if ?>
    <div class="fileIcon"><img src="<?php echo $file->getTypeIconUrl() ?>" alt="<?php echo $file->getFilename() ?>" /></div>
    <div class="fileInfo">
      <span class="fileDescription"><?php echo $attachment->getText() ?>:</span>
      <span class="fileName"><a href="<?php echo $file->getDetailsUrl() ?>" title="<?php echo lang('view file details') ?>"><?php echo clean($file->getFilename()) ?></a></span>
    </div>
    <div class="clear"></div>
  </div>
<?php
  } // if
} // if
} // if
?><commit_msg>commit 185 display image files as images in project description and auto-resize<commit_after><?php
if (plugin_active('files')) { 
$file = $attachment->getObject();
if (!$file) {
?>
  <div class="fileAttachment">
    <div class="fileIcon"><img src="<?php echo get_image_url('filetypes/unknown.png'); ?>" /></div>
    <div class="fileInfo">
      <span class="fileDescription"><?php echo $attachment->getText() ?>:</span>
      <span class="fileName"><?php echo lang('edit project to select file'); ?></span>
    </div>
    <div class="clear"></div>
  </div>

<?php 
} else {
  if ($file->canView(logged_user())) {
?>
  <div class="fileAttachment">
<?php if ($file->isPrivate()) { ?>
    <div class="private" title="<?php echo lang('private file') ?>"><span><?php echo lang('private file') ?></span></div>
<?php } // if ?>
<?php if ($file->getFileType()->getIsImage()) { ?>
  <img src="<?php echo $file->getDownloadUrl() ?>" style="max-height:100%; max-width:100%;">
<?php } else { ?>
    <!--- <div class="fileIcon"><img src="<?php echo $file->getTypeIconUrl() ?>" alt="<?php echo $file->getFilename() ?>" /></div> --->
    <div class="fileInfo">
      <span class="fileDescription"><?php echo $attachment->getText() ?>:</span>
      <span class="fileName"><a href="<?php echo $file->getDetailsUrl() ?>" title="<?php echo lang('view file details') ?>"><?php echo clean($file->getFilename()) ?></a></span>
    </div>
<?php } // if ?>
    <div class="clear"></div>
  </div>
<?php
  } // if
} // if
} // if
?>
{'fraction_non_alphanumeric': 0.25199709513435004, 'fraction_numerical': 0.0032679738562091504, 'mean_word_length': 4.401960784313726, 'pattern_counts': {'":': 0, '<': 105, '<?xml version=': 0, '>': 126, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5008342', 'n_tokens_mistral': 871, 'n_tokens_neox': 900, 'n_words': 214}