<!-- $Id: comment.tmpl,v 1.5 2004/06/14 11:26:52 rurban Exp $ -->
<?php
$CDATE = $WikiTheme->formatDateTime($COMMENT_CTIME);
$buttons = $modified = '';

if ($user->isAdmin() or $user->getId() == $COMMENT_CREATOR) {
    $buttons = HTML::small(array('class' => 'floatleft'),
                           Button('edit', false, $page));
    if ($user->isAdmin())
      $buttons->pushContent(Button('remove', false, $page));
}

// This is a hack, but since we only have a fake PageRevision,
// we can't get the version.
if ($rev->get('mtime') != $COMMENT_CTIME) {
    $mtime = $WikiTheme->formatDateTime($rev->get('mtime'));
    $modified = HTML::small(array('class' => 'floatright'),
			    fmt("Comment modified on %s by %s",
				$mtime, $rev->get('author')));
}
?>

<!-- FIXME: move table formatting to css -->
<div title="<?= fmt("Comments on %s by %s.", $COMMENT_PARENT, $COMMENT_CREATOR)?>"
     class="wikicomment wikitext">
  <div class="wikicomment-footer">
    <span class="floatright">
      <?= fmt("%s by %s", WikiLink($page, 'known', $CDATE), WikiLink($COMMENT_CREATOR, 'if_known')) ?></span>
    <br clear="all" class="clear-floats" />
  </div>
  <?php if ($buttons or $modified) { ?>
    <div class="floatright">
      <?= $buttons ?>
      <?= $modified ?>
      <br clear="all" />
    </div>
  <?php } ?>
  <div class="wikicomment-body">
    <?= $CONTENT ?>
  </div>
</div>
<hr class="no-css" />
