<!-- COMMENTS-->
<?php if( osc_comments_enabled() ) { ?>
<div id="comments">
<h2><?php _e('Comments', 'sigma'); ?></h2>
<?php if( ( osc_logged_user_id() == osc_item_user_id() ) && osc_logged_user_id() != 0 ) { ?>
<p class="problem own">
Attention : rédiger de faux avis est un motif de bannissement sans préavis du site
</p>
<?php }?>
<ul id="comment_error_list"></ul>
<?php CommentForm::js_validation(); ?>
<div class="comments_list">
<?php while ( osc_has_item_comments() ) { ?>
<div class="comment <?php if(osc_profile_img_users_enabled()) { ?>has-user-img<?php } ?>">
<?php if(osc_profile_img_users_enabled()) { ?>
<p class="user-img">
<img src="<?php echo osc_user_profile_img_url(osc_comment_user_id()); ?>" alt="<?php echo osc_esc_html(osc_comment_author_name()); ?>"/>
</p>
<?php } ?>
<?php
$datepubli = osc_comment_pub_date();
$datepubli2 = strftime(" %d %m %G - %H:%I", strtotime($datepubli));
?>
<h3><strong><?php echo osc_comment_title(); ?></strong> <em>(<?php _e("by", 'sigma'); ?> <?php echo osc_comment_author_name(); ?> le <?php echo "$datepubli2"; ?>)</em></h3>
<?php if(osc_enable_comment_rating()) { ?>
<p class="comment-rating">
<?php for($i = 1; $i <= 5; $i++) { ?>
<?php
$class = '';
if(osc_comment_rating() >= $i) {
$class = ' fill';
}
?>
<i class="fa fa-star<?php echo $class; ?>"></i>
<?php } ?>
<span>(<?php echo sprintf(__('%d of 5', 'sigma'), osc_comment_rating()); ?>)</span>
</p>
<?php } ?>
<p><?php echo nl2br( osc_comment_body() ); ?> </p>
<?php if ( osc_comment_user_id() && (osc_comment_user_id() == osc_logged_user_id()) ) { ?>
<p>
<a rel="nofollow" href="<?php echo osc_delete_comment_url(); ?>" title="<?php _e('Delete your comment', 'sigma'); ?>"><?php _e('Delete', 'sigma'); ?></a>
</p>
<?php } ?>
</div>
<?php } ?>
</div>
</div>
<?php } ?>
<?php if( osc_comments_enabled() ) { ?>
<?php if(osc_reg_user_post_comments() && osc_is_web_user_logged_in() || !osc_reg_user_post_comments()) { ?>
<div id="comments">
<div class="paginate"><?php echo osc_comments_pagination(); ?></div>
<div class="form-container form-horizontal new-comment">
<div class="header">
<h3><?php _e('Leave your comment (spam and offensive messages will be removed)', 'sigma'); ?></h3>
</div>
<div class="resp-wrapper">
<form action="<?php echo osc_base_url(true); ?>" method="post" name="comment_form" id="comment_form">
<fieldset>
<input type="hidden" name="action" value="add_comment" />
<input type="hidden" name="page" value="item" />
<input type="hidden" name="id" value="<?php echo osc_item_id(); ?>" />
<?php if(osc_is_web_user_logged_in()) { ?>
<input type="hidden" name="authorName" value="<?php echo osc_esc_html( osc_logged_user_name() ); ?>" />
<input type="hidden" name="authorEmail" value="<?php echo osc_logged_user_email();?>" />
<?php } else { ?>
<div class="control-group">
<label class="control-label" for="authorName"><?php _e('Your name', 'sigma'); ?></label>
<div class="controls">
<?php CommentForm::author_input_text(); ?>
</div>
</div>
<div class="control-group">
<label class="control-label" for="authorEmail"><?php _e('Your e-mail', 'sigma'); ?></label>
<div class="controls">
<?php CommentForm::email_input_text(); ?>
</div>
</div>
<?php }; ?>
<?php if(osc_enable_comment_rating()) { ?>
<div class="control-group">
<label class="control-label" for="title"><?php _e('Rating', 'sigma'); ?></label>
<div class="controls">
<?php //CommentForm::rating_input_text(); ?>
<input type="hidden" name="rating" value="" />
<div class="comment-leave-rating">
<i class="fa fa-star is-rating-item" data-value="1"></i>
<i class="fa fa-star is-rating-item" data-value="2"></i>
<i class="fa fa-star is-rating-item" data-value="3"></i>
<i class="fa fa-star is-rating-item" data-value="4"></i>
<i class="fa fa-star is-rating-item" data-value="5"></i>
</div>
<span class="comment-rating-selected"></span>
</div>
</div>
<?php } ?>
<div class="control-group">
<label class="control-label" for="title"><?php _e('Title', 'sigma'); ?></label>
<div class="controls">
<?php CommentForm::title_input_text(); ?>
</div>
</div>
<div class="control-group">
<label class="control-label" for="body"><?php _e('Comment', 'sigma'); ?></label>
<div class="controls textarea">
<?php CommentForm::body_input_textarea(); ?>
</div>
</div>
<div class="actions">
<button type="submit" class="btn btn-primary"><?php _e('Send', 'sigma'); ?></button>
</div>
</fieldset>
</form>
</div>
</div>
</div>
<?php } ?>
<?php } ?>
</div>
<!-- END COMMENTS-->