Skip to content

Commit

Permalink
status_indicator add attr option
Browse files Browse the repository at this point in the history
  • Loading branch information
Cavasin F committed Nov 9, 2023
1 parent f9d306c commit 2b81e3f
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions templates/components/status_indicator.html.twig
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
{% macro status_indicator(options) %}

{% set _color = options.color ?? 'green' %}
{% set _animated = options.animated ?? true %}
{% set _extraClass = options.extraClass ?? '' %}

<span class="status-indicator {{ _animated ? 'status-indicator-animated' : '' }} {{ 'status-'~_color }} {{ _extraClass }}">
<span class="status-indicator-circle"></span>
<span class="status-indicator-circle"></span>
<span class="status-indicator-circle"></span>
</span>

{% endmacro %}
{% macro status_indicator(options) %}
{% import '@Tabler/includes/utils.html.twig' as utils %}

{% set _color = options.color ?? 'green' %}
{% set _animated = (options.animated ?? true) is same as true %}
{% set _extraClass = options.extraClass ?? '' %}
{% set _attr = options.attr ?? {} %}

<span
class="status-indicator {% if _animated %}status-indicator-animated{% endif %} {{ 'status-'~_color }} {{ _extraClass }}"
{{ utils.attr_to_html(_attr) }}
>
<span class="status-indicator-circle"></span>
<span class="status-indicator-circle"></span>
<span class="status-indicator-circle"></span>
</span>

{% endmacro %}

0 comments on commit 2b81e3f

Please sign in to comment.