bootstrap_italia-8.x-0.x-dev/components/components-0x/chips/chip.twig

components/components-0x/chips/chip.twig
{#
/**
 * @file
 * Template for chip component.
 * Docs: https://italia.github.io/bootstrap-italia/docs/componenti/chips/
 * Latest revision: v2.6.1
 *
 * Available config:
 * - chip_icon: string | false
 * - avatar_img: link img | false
 * - sr_only_alt: string | false
 * - chip_label: string
 * - chip_url: string
 * - chip_close: true | false
 * - chip_lg: true | false
 * - chip_color: primary | secondary | success | danger | warning | false
 * - chip_disabled: true | false
 *
#}
{% apply spaceless %}
  {% include '@bi-bcl/deprecated.html.twig' with {
    old: 'bootstrap_italia_components/chips/chip.twig',
    new: 'bi-bcl/chip/chip.html.twig',
  } %}

  {# Redirect to new component #}
  {% if chip_url %}<a href="{{ chip_url }}">{% endif %}

    {% include '@bi-bcl/chip/chip.html.twig' with {
      chip_label: chip_label,
      chip_simple: (not chip_icon and not avatar_img and not chip_close) ? true,
      chip_icon: chip_icon,
      chip_dismissibile: chip_close,
      chip_large: chip_lg,
      chip_color: chip_color,
      chip_disabled: chip_disabled,
    } %}

    {% if avatar_image %}
      {% embed '@bi-bcl/chip/chip.html.twig' with {
        chip_label: chip_label,
        chip_simple: (not chip_icon and not avatar_img and not chip_close) ? true,
        chip_icon: chip_icon,
        chip_dismissibile: chip_close,
        chip_large: chip_lg,
        chip_color: chip_color,
        chip_disabled: chip_disabled,
      } %}
        {% block beforeContent %}
          {% embed '@bi-bcl/avatar/avatar.twig' with {
            avatar_size: 'xs',
            } %}
            {% block avatarContent %}
              <img src="{{ avatar_img }}" alt="{{ sr_only_alt }}">
            {% endblock %}
          {% endembed %}{# End embed avatar. #}
        {% endblock %}
      {% endembed %}{# End embed chip. #}
    {% else %}
      {% include '@bi-bcl/chip/chip.html.twig' with {
        chip_label: chip_label,
        chip_simple: (not chip_icon and not avatar_img and not chip_close) ? true,
        chip_icon: chip_icon,
        chip_dismissibile: chip_close,
        chip_large: chip_lg,
        chip_color: chip_color,
        chip_disabled: chip_disabled,
      } %}
    {% endif %}
  {% if chip_url %}</a>{% endif %}
{% endapply %}

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

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