diff --git a/templates/components/status.html.twig b/templates/components/status.html.twig index 761e649..f9b751e 100644 --- a/templates/components/status.html.twig +++ b/templates/components/status.html.twig @@ -1,16 +1,27 @@ -{% macro status(text, options) %} - {% set _color = options.color ?? 'green' %} - {% set _animated = options.animated ?? true %} - {% set _lite = options.lite is defined ? options.lite : false %} - {% set _with_dot = options.with_dot is defined ? options.with_dot : false %} - {% set _extraClass = options.extraClass ?? '' %} - - {%- apply spaceless -%} - - {% if _with_dot %} - - {% endif %} - {{ text }} - - {%- endapply -%} -{% endmacro %} +{% macro status(text, options) %} + {% import '@Tabler/includes/utils.html.twig' as utils %} + {% import '@Tabler/components/status_dot.html.twig' as status_dot %} + + {% set _color = options.color ?? 'green' %} + {% set _animated = (options.animated ?? true) is same as true %} + {% set _lite = (options.lite ?? false) is same as true %} + {% if options.with_dot is defined %} + {% deprecated 'with_dot option is deprecated, use withDot option instead!' %} + {% set _withDot = options.with_dot is same as true %} + {% else %} + {% set _withDot = (options.withDot ?? false) is same as true %} + {% endif %} + + {% set _extraClass = options.extraClass ?? '' %} + {% set _attr = options.attr ?? {} %} + + + {% if _withDot %} + {{ status_dot({color: _color, animated : _animated}) }} + {% endif %} + {{ text }} + +{% endmacro %} diff --git a/templates/components/status_dot.html.twig b/templates/components/status_dot.html.twig index 7ff6e8b..43371ae 100644 --- a/templates/components/status_dot.html.twig +++ b/templates/components/status_dot.html.twig @@ -1,7 +1,13 @@ {% macro status_dot(options) %} + {% import '@Tabler/includes/utils.html.twig' as utils %} + {% set _color = options.color ?? 'green' %} - {% set _animated = options.animated ?? true %} + {% set _animated = (options.animated ?? true) is same as true %} {% set _extraClass = options.extraClass ?? '' %} + {% set _attr = options.attr ?? {} %} - + {% endmacro %} diff --git a/templates/components/status_indicator.html.twig b/templates/components/status_indicator.html.twig index 0b83aef..afc5aab 100644 --- a/templates/components/status_indicator.html.twig +++ b/templates/components/status_indicator.html.twig @@ -1,13 +1,17 @@ -{% macro status_indicator(options) %} - - {% set _color = options.color ?? 'green' %} - {% set _animated = options.animated ?? true %} - {% set _extraClass = options.extraClass ?? '' %} - - - - - - - -{% 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 ?? {} %} + + + + + + +{% endmacro %}