<?php
if ( post_password_required() )
	return;
?>
	<div id="comments" class="comments-area">
	<?php if ( have_comments() ) : ?>
		<h2 class="comments-title">
			<?php printf( _nx( '<span>1</span> نظر', '<span>%1$s</span> نظر', get_comments_number(), 'dw-gamez' ), number_format_i18n( get_comments_number() ) ); ?>
		</h2>

		<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?>
		<nav id="comment-nav-above" class="comment-navigation" role="navigation">
			<h1 class="screen-reader-text sr-only"><?php _e( 'نظر ناوبری', 'dw-gamez' ); ?></h1>
			<div class="nav-previous"><?php previous_comments_link( __( '&larr; نظرات قدیمی', 'dw-gamez' ) ); ?></div>
			<div class="nav-next"><?php next_comments_link( __( 'جدید ترین نظرات &rarr;', 'dw-gamez' ) ); ?></div>
		</nav>
		<?php endif; ?>

		<ol class="comment-list">
			<?php wp_list_comments( array( 'callback' => 'dw_gamez_comment' ) ); ?>
		</ol>

		<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?>
		<nav id="comment-nav-below" class="comment-navigation" role="navigation">
			<h1 class="screen-reader-text"><?php _e( 'نظر ناوبری', 'dw-gamez' ); ?></h1>
			<div class="nav-previous"><?php previous_comments_link( __( '&larr; نظرات قدیمی', 'dw-gamez' ) ); ?></div>
			<div class="nav-next"><?php next_comments_link( __( 'جدیدترین نظرات &rarr;', 'dw-gamez' ) ); ?></div>
		</nav>
		<?php endif; ?>

	<?php endif; ?>

	<?php if ( ! comments_open() && '0' != get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) : ?>
		<p class="no-comments"><?php _e( 'نظرات بسته شده است .', 'dw-gamez' ); ?></p>
	<?php endif; ?>

	<?php comment_form( array(
		'comment_notes_before' => '<div class="row">',
		'comment_notes_after'	=> '</div>',
		'title_reply'       	=> __( '<span>نظر</span>خود را قرار دهید', 'dw-gamez' ),

		'logged_in_as' => '<p class="logged-in-as">' .
		sprintf(
		__( 'شما با این نام ورود کرده اید <a href="%1$s">%2$s</a>. <a href="%3$s" title="Log out of this account">خروج از ؟</a>' ),
		admin_url( 'profile.php' ),
		$user_identity,
		wp_logout_url( apply_filters( 'the_permalink', get_permalink( ) ) )
		) . '</p><div class="row">',

		'fields' => apply_filters( 'comment_form_default_fields', array(
			'author' =>
			'<div class="col-sm-4"><p class="comment-form-author">' .
			'<label for="author">' . __( 'نام', 'dw-gamez' ) . '</label> ' .
			( $req ? '<span class="required">*</span>' : '' ) .
			'<input id="author" class="form-control" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) .
			'" size="30"' . $req . ' /></p>',

			'email' =>
			'<p class="comment-form-email"><label for="email">' . __( 'ایمیل', 'dw-gamez' ) . '</label> ' .
			( $req ? '<span class="required">*</span>' : '' ) .
			'<input id="email" class="form-control" name="email" type="text" value="' . esc_attr(  $commenter['comment_author_email'] ) .
			'" size="30"' . $req . ' /></p>',

			'url' =>
			'<p class="comment-form-url"><label for="url">' .
			__( 'وب سایت', 'dw-gamez' ) . '</label>' .
			'<input id="url" class="form-control" name="url" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) .
			'" size="30" /></p></div>'
			)
		),

		'comment_field' =>  '<div class="col-sm-8"><p class="comment-form-comment"><label for="comment">' . __( 'نظر', 'dw-gamez' ) .
		    '</label><textarea id="comment" class="form-control" name="comment" aria-required="true">' .
	    '</textarea></p></div>',
	)); ?>

</div>
