<?php
/**
 * @package WordPress
 * @subpackage ROVERNET
 */

if ( post_password_required() ) : ?>
<p><?php _e('Enter your password to view comments.'); ?></p>
<?php return; endif; ?>
<div class="cmt">
<h2 id="comments">Komentáře</h2>

<?php if ( have_comments() ) : ?>
<?php foreach ($comments as $comment) : ?>
  <div class="comment clr">
    <div class="gravatar"><a href=""><img src="wp-content/themes/rovernet/images/sample/gravatar.jpg" alt="" /></a></div>
    <div class="ctxt">
      <div class="ca"><?php comment_author_link() ?> <i>•</i> <?php comment_date() ?> — <?php comment_time() ?></div>
      <?php comment_text() ?>
    </div>
  </div>
<?php endforeach; ?>

</ol>

<?php else : // If there are no comments yet ?>
	<p><?php _e('No comments yet.'); ?></p>
<?php endif; ?>
</div>

<?php if ( comments_open() ) : ?>
<?php if(!is_user_logged_in()){?>
<div class="cform">
  <form action="" method="post">
    <div class="notreg">
      <div class="clr">
        <p>Komentáře mohou přidávat pouze registrovaní uživatelé.</p>
        <a class="btn" href="<?php echo get_page_link(10)?>">Registrace</a>
        <a class="btn" href="<?php echo get_page_link(45)?>">Přihlášení</a>
      </div>
    </div>
  </form>
</div>
<?}else{?>
<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
<div class="cform">
  <h2>Přidej komentář</h2>
  <textarea name="comment" id="comment" cols="40" rows="8"></textarea>
  <input name="submit" class="sub" type="submit" value="Odeslat" />
  <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
  <?php do_action('comment_form', $post->ID); ?>
</div>
</form>
<?}?>

<?php else : // Comments are closed ?>
<p><?php _e('Sorry, the comment form is closed at this time.'); ?></p>
<?php endif; ?>
