{if !$reviews}
   {$reviews = $product_reviews.reviews}
{/if}
<div class="reviews-list">
   {foreach $reviews as $review}
      {if $review@index == 3 and $textReviewsCount >= 4 and !$cfg.tpl.product_reviews_ajax}
         <div data-more-reviews style="display: none;">
      {/if}

      {$translated_review = false}
      {if ($review.pros_original || $review.cons_original || $review.summary_original) and $review.id_language != $ctrl.active_language}
         {$translated_review = true}
      {/if}
      <div class="review-item">
         <div class="review-data">
            <div class="review-data-user-wrapper">
               <div class="review-avatar"></div>
               <div class="review-data-user">
                  {block "review-user-data"}
                     {if $review.rating}
                        <div class="review-stars review-stars-{$review.rating|round} {$colorClass}">
                           {for $i=1 to 5}
                              <i class="fc {if $i > $review.rating|round}icons_star_empty{else}icons_star_full{/if}"></i>
                           {/for}
                        </div>
                     {/if}
                     {$review.user_name|default:$review.name|default:"{t}Anonymní{/t}"}<br>
                     {if $review.user_city}
                        {$review.user_city}
                        <br>
                     {/if}
                     {if $review.date}<span>{$review.date|date_format:"%e.%-m.%Y"}</span>{/if}
                  {/block}
               </div>
            </div>
            {block "review-verified"}
               <p class="review-verified">
                  {if $review.verified}
                     <i class="fc icons_check-circle"></i>
                     {t}Recenze nakupujícího{/t}
                  {else}
                     {t}Recenze návštěvníka{/t}
                  {/if}
                  {$review.source}
               </p>
            {/block}
            <p class="review-report">
               <a href="" data-wpj-focus="{path('kupshop_content_contactform_sendform', ['type'=>'report-inappropriate-content', 'report_type'=>'reviews', 'content_id'=>{$review.id}])}" data-wpj-focus-ajax="1">
                  {t}Nahlásit{/t}
               </a>
            </p>
         </div>
         <div class="review-text">
            {block "review-text"}
               {if $review.pros}<p class="pros">{$review.pros}</p>{/if}
               {if $review.cons}<p class="cons">{$review.cons}</p>{/if}
               {if $review.summary}<p class="summary">{$review.summary}</p>{/if}
            {/block}

            {ifmodule PRODUCTS_COLLECTIONS}
            {if $review.id_product != $body.product.id and $review.id_product != $body_product_id}
               <p class="review-collection-product">{t}Původně vloženo k{/t} <a
                          href="{url s=product IDproduct=$review.id_product TITLE=$review.product_title}"
                          title="{t}Zobrazit produkt{/t}">{$review.product_title}</a></p>
            {/if}
            {/ifmodule}

            {block "review-responder"}
             {if $review.response}
                <div class="review-response-wrapper">
                   <div class="review-text review-response-text">
                      <p class="review-response-label">{t}reakce obchodu{/t} {$dbcfg.shop_title|lower}</p>
                      <p class="summary">{$review.response|nl2br nofilter}</p>
                   </div>
                   <div class="review-response-data">
                      <div class="review-avatar"></div>
                      <strong>{$dbcfg.shop_title|lower}</strong>
                       {if $review.response_time}
                          <br><span>{$review.response_time|date_format:"%e. %-m. %Y"}</span>
                       {/if}
                   </div>
                </div>
             {/if}
            {/block}

             {if $translated_review}
                <div class="review-original">
                   <div class="review-original-author">
                      {if $review.id_language != $ctrl.active_language}
                         {get_domain_by_language id_language=$review.id_language assign='domain'}
                         <p>
                            <span class="country-flag" style="background-image: url('/common/static/images/flags/{$review.id_language|lower}.svg');"></span> {t}Od zákazníka z{/t} {$domain}
                         </p>
                      {/if}
                      <a href="#" class="show-original-review" data-opener="[data-original-review='{$review.id}']"
                         data-text-hide="{t}Skrýt originál{/t}" rel="noreferrer">
                          {t}Zobrazit originál{/t}
                      </a>
                   </div>
                   <div class="opener-content" data-original-review="{$review.id}" style="display: none;">
                      <div class="review-text">
                          {if $review.pros_original}<p class="pros">{$review.pros_original}</p>{/if}
                          {if $review.cons_original}<p class="cons">{$review.cons_original}</p>{/if}
                          {if $review.summary_original}<p class="summary">{$review.summary_original}</p>{/if}
                      </div>
                   </div>
                </div>
             {/if}
         </div>
      </div>

      {if $review@last and $textReviewsCount >= 4 and !$cfg.tpl.product_reviews_ajax}
         </div>
      {/if}
   {/foreach}

   {if $cfg.tpl.product_reviews_ajax}
      <div data-more-reviews-container data-more-reviews style="display: none;"></div>
   {/if}
</div>
