From b07f879d64586c76b3ec6a70a2c28b69de594334 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Thu, 11 May 2023 16:57:45 +0200 Subject: [PATCH] macros: arguments are mostly defined, cleanup --- resources/views/macros/base.twig | 4 ++-- resources/views/macros/form.twig | 6 +++--- resources/views/pages/design.twig | 2 +- resources/views/pages/messages/overview.twig | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/resources/views/macros/base.twig b/resources/views/macros/base.twig index d62e7c51..528beddb 100644 --- a/resources/views/macros/base.twig +++ b/resources/views/macros/base.twig @@ -36,9 +36,9 @@ {% macro button(label, url, type, size, title, icon_left, icon_right) %} - {%- if icon_left is defined %}{{ _self.icon(icon_left) }}{% endif %} + {%- if icon_left %}{{ _self.icon(icon_left) }}{% endif %} {{ label }} - {%- if icon_right is defined %}{{ _self.icon(icon_right) }}{% endif %} + {%- if icon_right %}{{ _self.icon(icon_right) }}{% endif %} {% endmacro %} diff --git a/resources/views/macros/form.twig b/resources/views/macros/form.twig index d776db02..9b3f907d 100644 --- a/resources/views/macros/form.twig +++ b/resources/views/macros/form.twig @@ -87,7 +87,7 @@ Also adds buttons to increment / decrement the value. #} {% macro number(name, label, opt) %}
- {% if label is defined -%} + {% if label -%} {% if opt.required_icon|default(false) %} {{ _self.entry_required() }} @@ -142,7 +142,7 @@ Also adds buttons to increment / decrement the value. #} {% macro textarea(name, label, opt) %}
- {% if label is defined -%} + {% if label -%} {% if opt.required_icon|default(false) %} {{ _self.entry_required() }} @@ -180,7 +180,7 @@ Renders a select element wrapped in a DIV with mb-3. #} {% macro select(name, label, data, opt) %}
- {% if label is defined -%} + {% if label -%}
- {{ f.button('Small button with icons', { + {{ f.button('sm button with icons', { 'size': 'sm', 'icon_left': 'check', 'icon_right': 'info', diff --git a/resources/views/pages/messages/overview.twig b/resources/views/pages/messages/overview.twig index d12caaf6..cfc681ac 100644 --- a/resources/views/pages/messages/overview.twig +++ b/resources/views/pages/messages/overview.twig @@ -21,7 +21,7 @@ 'default_option': __('message.choose_angel'), }) }}
-
+
{{ f.submit(__('message.to_conversation'), {'btn_type': 'secondary'}) }}