You are here

like-and-dislike-icons.html.twig in Open Social 8.6

The template file for the like and dislike links.

Template used to display icons for the like and dislike links.

Available variables:

  • likes : The number of likes.
  • dislikes : The number of dislikes.
  • entity_id : The id of the entity for which is the vote is done.
  • entity_type : The entity type id of the entity for which the vote is done.
  • like_attributes : Set of attributes for like link.
  • dislike_attributes : Set of attributes for dislike link.

File

themes/socialbase/templates/like/like-and-dislike-icons.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * The template file for the like and dislike links.
  5. *
  6. * Template used to display icons for the like and dislike links.
  7. *
  8. * Available variables:
  9. * - likes : The number of likes.
  10. * - dislikes : The number of dislikes.
  11. * - entity_id : The id of the entity for which is the vote is done.
  12. * - entity_type : The entity type id of the entity for which the vote is
  13. * done.
  14. * - like_attributes : Set of attributes for like link.
  15. * - dislike_attributes : Set of attributes for dislike link.
  16. */
  17. #}
  18. <div class="vote-widget vote-widget--like-and-dislike">
  19. <div class="vote__wrapper">
  20. <div class="vote-like type-{{ entity_type }}" id="like-container-{{ entity_type }}-{{ entity_id }}">
  21. <a {{ like_attributes }} >
  22. <svg class="icon-vote">
  23. <use xlink:href="#icon-like"></use>
  24. </svg>
  25. </a>
  26. </div>
  27. <div class="vote-dislike type-{{ entity_type }}" id="dislike-container-{{ entity_type }}-{{ entity_id }}">
  28. <a {{ dislike_attributes }}>Dislike</a>
  29. <span class="count">{{ dislikes }}</span>
  30. </div>
  31. <div class="vote__count">
  32. {% if logged_in %}
  33. <a class="use-ajax" data-dialog-options='{"title":"{{ modal_title }}","width":"auto"}' data-dialog-type="modal" href="/wholiked/{{ entity_type }}/{{ entity_id }}">
  34. {% trans %}{{ likes }} like {% plural likes %} {{ likes }} likes{% endtrans %}
  35. </a>
  36. {% else %}
  37. {% trans %}{{ likes }} like {% plural likes %} {{ likes }} likes{% endtrans %}
  38. {% endif %}
  39. </div>
  40. </div>
  41. </div>