mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
- Add ancestors CSS classes on UIBlocks when missing (programmatically) - Fix SCSS due to some blocks inheriting their ancestors rules
29 lines
1.4 KiB
Twig
29 lines
1.4 KiB
Twig
{% set sAriaLabel = oUIBlock.GetLabel() is not empty ? oUIBlock.GetLabel() : (oUIBlock.GetTooltip() is not empty ? oUIBlock.GetTooltip() : '') %}
|
|
<a id="{{ oUIBlock.GetId() }}"
|
|
class="{{ oUIBlock.GetBlocksInheritanceCSSClassesAsString() }} {{ oUIBlock.GetAdditionalCSSClassesAsString() }} ibo-is-{{ oUIBlock.GetActionType() }} ibo-is-{{ oUIBlock.GetColor() }} {% if oUIBlock.IsHidden() %}ibo-is-hidden{% endif %}"
|
|
data-role="ibo-button"
|
|
{% if oUIBlock.GetDataAttributes() %}
|
|
{% for sName, sValue in oUIBlock.GetDataAttributes() %}
|
|
data-{{ sName }}="{{ sValue }}"
|
|
{% endfor %}
|
|
{% endif %}
|
|
href="{{ oUIBlock.GetURL() }}"
|
|
target="{{ oUIBlock.GetTarget() }}"
|
|
{# Visual tooltip... #}
|
|
{% if oUIBlock.GetTooltip() is not empty %}
|
|
data-tooltip-content="{{ oUIBlock.GetTooltip() }}"
|
|
{% else %}
|
|
title="{{ oUIBlock.GetLabel() }}"
|
|
{% endif %}
|
|
{# ... and accessibility title. Important especially in case the button has no label, but only an icon #}
|
|
{% if sAriaLabel is not empty %}
|
|
aria-label="{{ sAriaLabel }}"
|
|
{% endif %}
|
|
>
|
|
{% if oUIBlock.GetIconClass() is not empty %}
|
|
<span class="ibo-button--icon {{ oUIBlock.GetIconClass() }}"></span>
|
|
{% endif %}
|
|
{% if oUIBlock.GetLabel() is not empty %}
|
|
<span class="ibo-button--label">{{ oUIBlock.GetLabel() }}</span>
|
|
{% endif %}
|
|
</a> |