1
0
mirror of https://github.com/tabler/tabler.git synced 2025-12-25 11:29:57 +04:00
Files
tabler/pages/_includes/ui/form/check.html
2019-10-02 00:15:52 +02:00

19 lines
1.2 KiB
HTML

{% assign type = include.type | default: 'checkbox' %}
{% assign checked = include.checked | default: false %}
{% assign disabled = include.disabled | default: false %}
{% assign switch = include.switch | default: false %}
{% assign title = include.title | default: false %}
{% assign is_empty = include['empty'] | default: false %}
{% unless title %}
{% assign title = '' %}
{% if disabled %}{% assign title = title | append: ' disabled' %}{% endif %}
{% if checked %}{% assign title = title | append: ' checked' %}{% endif %}
{% if switch %}{% assign title = title | append: ' switch' %}{% endif %}
{% assign title = title | append: ' ' | append: type %}
{% assign title = title | append: ' input' | lstrip | capitalize %}
{% endunless %}
<label class="form-check{% if include.inline %} form-check-inline{% endif %}{% if switch %} form-switch{% endif %}{% if include.class %} {{ include.class }}{% endif %}">
<input class="form-check-input{% if is_empty %} position-static{% endif %}" type="{{ type }}"{% if checked %} checked{% endif %}{% if disabled %} disabled{% endif %}>
{% unless is_empty %}<span class="form-check-label">{{ title }}</span>{% endunless %}
</label>