You are here

rate-template-fivestar.html.twig in Rate 8

Default theme implementation for fivestart voting display.

Available variables:

  • widget_attributes: Attributes for outer div.
  • has_voted: Boolean if user has voted.
  • user_voted: What the user voted.
  • stars: The images/text to display for voting.
  • undo: Link to undo placed vote.
  • undo_attributes: Attributes for undo div.
  • info_description: Extra textual info to display.

File

templates/rate-template-fivestar.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation for fivestart voting display.
  5. *
  6. * Available variables:
  7. * - widget_attributes: Attributes for outer div.
  8. * - has_voted: Boolean if user has voted.
  9. * - user_voted: What the user voted.
  10. * - stars: The images/text to display for voting.
  11. * - undo: Link to undo placed vote.
  12. * - undo_attributes: Attributes for undo div.
  13. * - info_description: Extra textual info to display.
  14. *
  15. * @ingroup themeable
  16. */
  17. #}
  18. <div{{ widget_attributes }}>
  19. <div class="item-list">
  20. <ul>
  21. {% for index, star in stars %}
  22. <li>
  23. {% if has_voted or not can_vote %}
  24. <div{{ star.star_attributes }}>{{ 'Star'|t }}</div>
  25. {% else %}
  26. <a {{ star.star_attributes }} href="{{ star.star_link }}">{{ 'Star'|t }}</a>
  27. {% endif %}
  28. </li>
  29. {% endfor %}
  30. </ul>
  31. {% if undo %}
  32. <div{{ undo_attributes }}>{{ undo }}</div>
  33. {% endif %}
  34. {{ info_description }}
  35. </div>
  36. </div>