You are here

rate-template-thumbs-up.html.twig in Rate 8

Default theme implementation for up/down voting display.

Available variables:

  • widget_attributes: Attributes for outer div.
  • has_voted: Boolean if user has voted.
  • user_voted: What the user voted.
  • up_attributes: Attributes for up div or link.
  • up_url: Url for an up vote.
  • score_attributes: Attributes for score display div.
  • up_votes: Number of up votes.
  • undo: Link to undo placed vote.
  • undo_attributes: Attributes for undo div.
  • info_description: Extra textual info to display.

File

templates/rate-template-thumbs-up.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation for up/down 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. * - up_attributes: Attributes for up div or link.
  11. * - up_url: Url for an up vote.
  12. * - score_attributes: Attributes for score display div.
  13. * - up_votes: Number of up votes.
  14. * - undo: Link to undo placed vote.
  15. * - undo_attributes: Attributes for undo div.
  16. * - info_description: Extra textual info to display.
  17. *
  18. * @ingroup themeable
  19. */
  20. #}
  21. <div{{ widget_attributes }}>
  22. {% if has_voted or not can_vote %}
  23. <div{{up_attributes}}>{{ 'Up'|t }}</div>
  24. {% else %}
  25. <a {{ up_attributes }} href="{{ up_url }}">{{ 'Up'|t }}</a>
  26. {% endif %}
  27. <div{{ score_attributes }}>{{ up_votes }}</div>
  28. {% if undo %}
  29. <div{{ undo_attributes }}>{{ undo }}</div>
  30. {% endif %}
  31. {{ info_description }}
  32. </div>