<?php
global $post;
$id = $post->ID;
wp_reset_query();
?>

<?php if ( $comments ) : ?>
    <section class="comments">
            <div class="comments-wrapper__title"><?php echo __('Comments','mostbet'); ?></div>
            <ol class="comments">
                <?php foreach ( $comments as $comment ) : ?>
                    <li class="comment_item" id="comment-<?php comment_ID(); ?>"
                        class="<?php if ( $comment->user_id == 1 ) {
                            echo "authcomment";
                        } ?>">
                        <?php if ( $comment->comment_approved == '0' ) : ?>
                            <p><?php echo __('Your comment is awaiting approval','mostbet'); ?></p>
                        <?php endif; ?>
                        <div class="ava">
                            <?php echo get_avatar($comment,90); ?>
                        </div>
                        <div class="comm_text">
                            <div class="name"><?php comment_author_link(); ?></div>
                            <?php comment_text(); ?>
                        </div>
                    </li>
                <?php endforeach; ?>
            </ol>
    </section>
<?php endif; ?>

<?php if ( comments_open() ) : ?>
    <section class="comments">
            <div class="comments-wrapper">
                <div class="comments-wrapper__info">
                    <div class="comments-wrapper__title"><?php echo __('Add cooment','mostbet'); ?></div>
                    <div class="comments-wrapper__subtitle">
                        <?php echo __('Your email address will not be published. Required fields are marked *','mostbet'); ?>
                    </div>
                </div>
                <?php if ( get_option( 'comment_registration' ) && ! $user_ID ) : ?>
                    <p><?php echo __('You must be','mostbet'); ?> <a
                        href="<?php echo get_option( 'siteurl' ); ?>/wp-login.php?redirect_to=<?php echo urlencode( get_permalink() ); ?>"><?php echo __('logged in','mostbet'); ?></a>
                    <?php echo __('to send comments','mostbet'); ?></p><?php else : ?>
                    <form action="<?php echo get_option( 'siteurl' ); ?>/wp-comments-post.php" method="post"
                          id="commentform" class="comments-wrapper__form">
                        <?php if ( $user_ID ) : ?>
                            <p><?php echo __('You are logged in as','mostbet'); ?><a style="color: #0748bd;"
                                               href="<?php echo get_option( 'siteurl' ); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>.
                                <a style="color: #0748bd;"
                                   href="<?php echo get_option( 'siteurl' ); ?>/wp-login.php?action=logout"
                                   title="Log out of this account"><?php echo __('Logout &raquo;','mostbet'); ?></a></p>
                        <?php else : ?>
                            <div class="comments-wrapper__wrp-input">
                                <label class="comments-wrapper__lable"><?php echo __('Name','mostbet'); ?></label>
                                <input type="text" class="comments-wrapper__form-control" name="author" id="author"
                                       value="<?php echo $comment_author; ?>">
                            </div>
                            <div class="comments-wrapper__wrp-input">
                                <label class="comments-wrapper__lable"><?php echo __('Email *','mostbet'); ?></label>
                                <input type="text" class="comments-wrapper__form-control" name="email" id="email"
                                       value="<?php echo $comment_author_email; ?>">
                            </div>

                        <?php endif; ?>
                        <div class="comments-wrapper__wrp-area">
                            <label class="comments-wrapper__lable"><?php echo __('Comment','mostbet'); ?></label>
                            <textarea class="comments-wrapper__textarea" name="comment" id="comment"></textarea>
                        </div>

                        <?php //show_subscription_checkbox(); ?>
                        <div class="comments-wrapper__wrp-btn">
                            <button type="submit" class="comments-wrapper__submit" id="submit"><?php echo __('Send comment','mostbet'); ?>
                            </button>
                        </div>

                        <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>"/>
                        <?php do_action( 'comment_form', $post->ID ); ?>
                    </form>
                <?php endif; ?>
            </div>

    </section>
<?php endif; ?>

