templates/Slivki/mobile/sale/vote_entity_block.html.twig line 1

Open in your IDE?
  1. {% if app.user %}
  2.     <div class="text-center vote-entity-block {{ additionalClass }}">
  3.         <div>
  4.             {% if userVote == 0 %}
  5.                 <span id="votePls">{{ pleaseVoteText }}</span>
  6.             {% endif %}
  7.             <div id="yourVote" class="{{ userVote == 0 ? ' d-none' }}">Ваша оценка: <span>{{ userVote }}</span></div>
  8.         </div>
  9.         {% set ratingWithCount = getEntityRatingWithCount(constant('Slivki\\Entity\\Category::SALE_CATEGORY_ID'), sale.getID()) %}
  10.         {% set ratingPercentage =  userVote == 0 ? 0 : ratingWithCount.rating * 100 / 5 %}
  11.         {% apply spaceless %}
  12.             <div class="star-ratings-css enabled align-middle">
  13.                 <div class="star-ratings-css-top" style="width: {{ ratingPercentage }}%">
  14.                     {% for i in 1..5 %}
  15.                         <span data-id="{{ i }}">★</span>
  16.                     {% endfor %}
  17.                 </div>
  18.                 <div class="star-ratings-css-bottom">
  19.                     {% for i in 1..5 %}
  20.                         <span data-id="{{ i }}">☆</span>
  21.                     {% endfor %}
  22.                 </div>
  23.             </div>
  24.         {% endapply %}
  25.         <span id="avgSaleRating" class="align-middle {{ userVote == 0 ? ' d-none' }}">(<span>{{ ratingWithCount.rating|number_format(1) }}</span>)</span>
  26.         <div id="totalSaleVotes" class="{{ userVote == 0 ? ' d-none' }}">Всего голосов: <span id="totalSaleVotesCnt">{{ ratingWithCount.ratingCount }}</span></div>
  27.     </div>
  28. {% endif %}