<?php if ( ! post_password_required() ) : ?>
    <div id="reviews" class="reviews-area">
        <?php comment_form( array(
            'title_reply'           => __( 'Post New Review', 'realia' ),
            'label_submit'          => __( 'Submit Review', 'realia' ),
            'comment_notes_before'  => false,
            'comment_notes_after'   => false,
            'comment_field'         => Realia_Template_Loader::load( 'reviews/review-field-comment' ),
        ) ); ?>

        <?php if ( have_comments() ) : ?>
            <h2 class="review-title"><?php echo __( 'User Reviews', 'realia' ); ?></h2>

            <ol class="review-list">
                <?php wp_list_comments( array(
                    'style'         => 'ol',
                    'short_ping'    => true,
                    'avatar_size'   => 70,
                    'callback'      => 'Realia_Reviews::get_review_template',
                ) ); ?>
            </ol><!-- /.comment-list -->

            <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?>
                <nav id="comment-nav-below" class="navigation review-navigation" role="navigation">
                    <div class="nav-previous"><?php previous_comments_link( __( 'Older Reviews', 'realia' ) ); ?></div>
                    <div class="nav-next"><?php next_comments_link( __( 'Newer Reviews', 'realia' ) ); ?></div>
                </nav><!-- /.review-navigation -->
            <?php endif; ?>

            <?php if ( ! comments_open() ) : ?>
                <p class="no-comments"><?php echo __( 'Reviews are closed.', 'realia' ); ?></p>
            <?php endif; ?>
        <?php endif; ?>


        <?php if ( empty( $commenter['comment_rating'] ) ) : ?>
            <?php $commenter['comment_rating'] = ''; ?>
        <?php endif; ?>
    </div><!-- /#comments -->
<?php endif; ?>