apostrophe
Version:
The Apostrophe Content Management System.
48 lines (37 loc) • 1.98 kB
HTML
{% macro base(label, options, classes) -%}
{%- if options.url -%}
<a href="{{ options.url }}" class="apos-button {{ classes }}" {% if options.tooltip %}data-apos-tooltip="{{ options.tooltip }}"{% endif %} {{ options.attributes }} data-apos-{{ options.action | css }}{% if options.value %}='{{ options.value }}'{% endif %}><span class="apos-button-label">{{ __ns('apostrophe', label | d('')) }}</span>{% if options.icon %}<i class="fa fa-{{ options.icon }}"></i>{% endif %}</a>
{%- else -%}
<button class="apos-button {{ classes }}" type="button" {% if options.tooltip %}data-apos-tooltip="{{ options.tooltip }}"{% endif %} {{ options.attributes }} data-apos-{{ options.action | css }}{% if options.value %}='{{ options.value }}'{% endif %}><span class="apos-button-label">{{ __ns('apostrophe', label | d('')) }}</span>{% if options.icon %}<i class="fa fa-{{ options.icon }}"></i>{% endif %}</button>
{%- endif -%}
{%- endmacro %}
{% macro normal(label, options) -%}
{{ base(label, options, '') }}
{%- endmacro %}
{% macro disabled(label, options) -%}
{{ base(label, options, 'apos-button--disabled') }}
{%- endmacro %}
{% macro inContext(label, options) -%}
{{ base(label, options, 'apos-button--in-context') }}
{%- endmacro %}
{% macro more(label, options) -%}
{{ base(label, options, 'apos-button--more') }}
{%- endmacro %}
{% macro action(label, options) -%}
{{ base(label, options, 'apos-button--action') }}
{%- endmacro %}
{% macro global(label, options) -%}
{{ base(label, options, 'apos-button--global') }}
{%- endmacro %}
{% macro major(label, options) -%}
{{ base(label, options, 'apos-button--major') }}
{%- endmacro %}
{% macro minor(label, options) -%}
{{ base(label, options, 'apos-button--minor') }}
{%- endmacro %}
{% macro danger(label, options) -%}
{{ base(label, options, 'apos-button--danger') }}
{%- endmacro %}
{% macro inGroup(label, options) -%}
{{ base(label, options, 'apos-button--in-group') }}
{%- endmacro %}