КОНТРОЛЫ/button.md


Исходный код

Twig код

{% if not type %}{% set type = "button" %}{% endif %}
{% if context_menu %}
  <div class="button-input-wrapper {{class_name}}">
{% endif %}
    <button type="{{type}}" {{ additional_data|raw }} class="button-input {% if blue %}button-input_blue{% endif %} {% if context_menu %}button-input-with-menu{% endif %} {% if disabled %}button-input-disabled{% endif %} {% if not context_menu %}{{class_name}}{% else %}{{button_input_class_name}}{% endif %}" tabindex="{{tab_index}}" {% if id %}id="{{id}}"{% endif %} {% if title %}title="{{title|capitalize}}"{% endif %}>
      {% block button_content %}
        {% if not plain %}<span class="button-input-inner {{inner_class_name}}">{% endif %}
          {% if icon_class_name %}<span class="icon icon-inline {{icon_class_name}}"></span>{% endif %}

          {% if svg_class_name %}<svg class="svg-icon svg-{{svg_class_name}}-dims"><use xlink:href="#{{svg_class_name}}"></use></svg>{% endif %}

          {% if text_short %}
            <span class="button-input-inner__text button-input-inner__text_short">{{ text_short }}</span>
          {% endif %}

          {% if text %}
            <span class="button-input-inner__text">
              {% if should_be_raw %}
                {{ text|raw }}
              {% else %}
                {{ text }}
              {% endif %}
              {% if text_bold %} <b>{{text_bold}}</b>{% endif %}
            </span>
          {% endif %}

          {% if icon_right_name %}<span class="{{ icon_right_name }} icon-right"></span>{% endif %}
        {% if not plain %}</span>{% endif %}
      {% endblock %}
    </button>

{% if context_menu %}
	{% if context_menu != 1 %}
    {% include 'interface/controls/button/context_menu.twig' with {
      context_menu_class_name: context_menu_class_name,
      context_menu: context_menu
    } %}
	{% endif %}
</div>
{% endif %}

Ссылка на вики репозиторий