like-and-dislike-icons.html.twig in Open Social 8.3
Same filename and directory in other branches
- 8.9 themes/socialbase/templates/like/like-and-dislike-icons.html.twig
- 8 themes/socialbase/templates/like/like-and-dislike-icons.html.twig
- 8.2 themes/socialbase/templates/like/like-and-dislike-icons.html.twig
- 8.4 themes/socialbase/templates/like/like-and-dislike-icons.html.twig
- 8.5 themes/socialbase/templates/like/like-and-dislike-icons.html.twig
- 8.6 themes/socialbase/templates/like/like-and-dislike-icons.html.twig
- 8.7 themes/socialbase/templates/like/like-and-dislike-icons.html.twig
- 8.8 themes/socialbase/templates/like/like-and-dislike-icons.html.twig
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.twigView source
- {#
- /**
- * @file
- * 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.
- */
- #}
-
- <div class="vote-widget vote-widget--like-and-dislike">
- <div class="vote__wrapper">
- <div class="vote-like type-{{ entity_type }}" id="like-container-{{ entity_type }}-{{ entity_id }}">
- <a {{ like_attributes }} >
- <svg class="icon-vote">
- <use xlink:href="#icon-like"></use>
- </svg>
- </a>
- </div>
-
- <div class="vote-dislike type-{{ entity_type }}" id="dislike-container-{{ entity_type }}-{{ entity_id }}">
- <a {{ dislike_attributes }}>Dislike</a>
- <span class="count">{{ dislikes }}</span>
- </div>
-
- <div class="vote__count">
- {% if logged_in %}
- <a class="use-ajax" data-dialog-options='{"title":"{{ modal_title }}","width":"auto"}' data-dialog-type="modal" href="/wholiked/{{ entity_type }}/{{ entity_id }}">
- {% trans %}{{ likes }} like {% plural likes %} {{ likes }} likes{% endtrans %}
- </a>
- {% else %}
- {% trans %}{{ likes }} like {% plural likes %} {{ likes }} likes{% endtrans %}
- {% endif %}
- </div>
- </div>
- </div>