wxt_bootstrap-8.x-1.10/templates/flag/flag.html.twig

templates/flag/flag.html.twig
{#
/**
 * @file
 * Default theme implementation for flag links.
 *
 * Available variables:
 * - attributes: HTML attributes for the link element.
 * - title: The flag link title.
 * - action: 'flag' or 'unflag'
 * - flag: The flag object.
 * - flaggable: The flaggable entity.
 */
#}
{% spaceless %}
{# Attach the flag CSS library.#}
{{ attach_library('flag/flag.link') }}

{# Depending on the flag action, set the appropriate action class. #}
{% if action == 'unflag' %}
    {% set action_class = 'action-unflag' %}
{% else %}
    {% set action_class = 'action-flag' %}
{% endif %}

{# Set the remaining Flag CSS classes. #}
{% set classes = [
'btn',
'btn-default',
'flag',
'flag-' ~ flag.id(),
'flag-' ~ flag.id() ~ '-' ~ flaggable.id(),
action_class
] %}

{# Set nofollow to prevent search bots from crawling anonymous flag links #}
{% set attributes = attributes.setAttribute('rel', 'nofollow') %}

<div class="{{classes|join(' ')}}"><a{{ attributes }}><span class="glyphicon glyphicon-thumbs-up"></span> {{ title }}</a></div>
{% endspaceless %}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc