<div id="comment-<?php print $node->nid; ?>" class="comment tt-comment <?php print $zebra; ?> clearfix">

<h3 class="title"><?php print $comment_link; ?></h3>
  
<?php
if ($first_new) {
  print $first_new;
}
if ($new_output) {
  print $new_output;
}

$author_created = format_date($node->created, 'short');
$author_changed = format_date($node->changed, 'short');

$data = '<div class="tt-author">';
$data .= '<div class="tt-created">' . t('!created; !author', array(
    '!created' => '<span class="tt-date">' . $author_created . '</span>',
    '!author' => '<span class="tt-name">' . theme('username', $node) . '</span>')
) . '</div>';
if ($author_created != $author_changed) {
  $data .= '<div class="tt-updated">' . t('!changed; updated', array(
    '!changed' => '<span class="tt-date">' . $author_changed . '</span>')
  ) . '</div>';
}
$data .= '</div>';

print $data;

$changes = unserialize($node->field_stormticketc_changes[0]['value']);
if (count($changes)) {
  $data = '';
  if (isset($changes['title_old'])) {
    $data .= '<div class="tt-label">' . t('Title') . '</div>';
    $data .= '<div class="tt-old">' . $changes['title_old'] . '</div>';
    $data .= '<div class="tt-new">' . $node->field_stormticketc_title[0]['value'] . '</div>';
  }
  if (isset($changes['category_old'])) {
    $data .= '<div class="tt-label">' . t('Category') . '</div>';
    $data .= '<div class="tt-old">' . t(storm_attribute_value('Ticket category', $changes['category_old'])) . '</div>';
    $data .= '<div class="tt-new">' . t(storm_attribute_value('Ticket category', $node->field_stormticketc_category[0]['value'])) . '</div>';
  }
  if (isset($changes['status_old'])) {
    $data .= '<div class="tt-label">' . t('Status') . '</div>';
    $data .= '<div class="tt-old">' . t(storm_attribute_value('Ticket status', $changes['status_old'])) . '</div>';
    $data .= '<div class="tt-new">' . t(storm_attribute_value('Ticket status', $node->field_stormticketc_status[0]['value'])) . '</div>';
  }
  if (isset($changes['priority_old'])) {
    $data .= '<div class="tt-label">' . t('Priority') . '</div>';
    $data .= '<div class="tt-old">' . t(storm_attribute_value('Ticket priority', $changes['priority_old'])) . '</div>';
    $data .= '<div class="tt-new">' . t(storm_attribute_value('Ticket priority', $node->field_stormticketc_priority[0]['value'])) . '</div>';
  }
  if (isset($changes['assigned_old']) && isset($changes['assigned_new'])) {
    $data .= '<div class="tt-label">' . t('Assigned') . '</div>';
    $data .= '<div class="tt-old">' . ($changes['assigned_old'] == '&nbsp;' ? t('Not assigned') : $changes['assigned_old']) . '</div>';
    $data .= '<div class="tt-new">' . ($changes['assigned_new'] == '&nbsp;' ? t('Not assigned') : $changes['assigned_new']) . '</div>';
  }
  if (!empty($data)) {
    print '<div class="tt-changed">' . $data . '</div>';
  }
}
?>

<div class="content">
<?php print $content ?>
<?php if ($signature): ?>
<div class="user-signature clearfix">
<div>—</div>
<?php print $signature ?>
</div>
<?php endif; ?>
</div>

<?php if ($links): ?>
<div class="links"><?php print $links; ?></div>
<?php endif; ?>

</div><!-- /.comment -->

