Guest User

Untitled

a guest
Jun 25th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. {#
  2. /**
  3. * @file
  4. * Overriding base flag link template
  5. *
  6. * Available variables:
  7. * - attributes: HTML attributes for the link element.
  8. * - title: The flag link title.
  9. * - action: 'flag' or 'unflag'
  10. * - flag: The flag object.
  11. * - flaggable: The flaggable entity.
  12. */
  13. #}
  14. {% spaceless %}
  15. {# Attach the flag CSS library.#}
  16. {{ attach_library('flag/flag.link') }}
  17.  
  18. {# Depending on the flag action, set the appropriate action class. #}
  19. {% if action == 'unflag' %}
  20. {% set action_class = 'action-unflag' %}
  21. {% else %}
  22. {% set action_class = 'action-flag' %}
  23. {% endif %}
  24.  
  25. {# Set the remaining Flag CSS classes. #}
  26. {%
  27. set classes = [
  28. 'flag',
  29. 'flag-' ~ flag.id()|clean_class,
  30. 'js-flag-' ~ flag.id()|clean_class ~ '-' ~ flaggable.id(),
  31. action_class
  32. ]
  33. %}
  34.  
  35. {# Attach flag count. #}
  36. {% set count = '[' ~ flagcount(flag, flaggable) ~ ']' %}
  37.  
  38. {# Set nofollow to prevent search bots from crawling anonymous flag links #}
  39. {% set attributes = attributes.setAttribute('rel', 'nofollow') %}
  40.  
  41. <div class="{{classes|join(' ')}}"><a{{ attributes }}>{{ title }}</a></div>
  42.  
  43. <div class="bs-field-like-count">
  44. <span class="fa-layers fa-fw">
  45. <i class="fas fa-bookmark"></i>
  46. <span class="fa-layers fa-fw">
  47. <i class="fas fa-heart"></i>
  48. <span class="fa-layers-text">{{ count }}</span>
  49. </span>
  50. </span>
  51. </div>
  52.  
  53. {% endspaceless %}
Add Comment
Please, Sign In to add comment