macros: arguments are mostly defined, cleanup
This commit is contained in:
parent
2e26f41964
commit
b07f879d64
|
@ -36,9 +36,9 @@
|
|||
|
||||
{% macro button(label, url, type, size, title, icon_left, icon_right) %}
|
||||
<a href="{{ url }}" class="btn btn-{{ type|default('secondary') }}{% if size %} btn-{{ size }}{% endif %}"{% if title %} title="{{ title }}"{% endif %}>
|
||||
{%- 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 %}
|
||||
</a>
|
||||
{% endmacro %}
|
||||
|
||||
|
|
|
@ -87,7 +87,7 @@ Also adds buttons to increment / decrement the value.
|
|||
#}
|
||||
{% macro number(name, label, opt) %}
|
||||
<div class="mb-3">
|
||||
{% if label is defined -%}
|
||||
{% if label -%}
|
||||
<label class="form-label" for="{{ name }}">{{ label }}</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) %}
|
||||
<div class="mb-3">
|
||||
{% if label is defined -%}
|
||||
{% if label -%}
|
||||
<label class="form-label" for="{{ name }}">{{ label }}</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) %}
|
||||
<div class="mb-3">
|
||||
{% if label is defined -%}
|
||||
{% if label -%}
|
||||
<label class="form-label" for="{{ name }}">
|
||||
{{ label }}
|
||||
{% if opt.required_icon|default(false) %}
|
||||
|
|
|
@ -333,7 +333,7 @@
|
|||
{{ f.button('Button') }}
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
{{ f.button('Small button with icons', {
|
||||
{{ f.button('sm button with icons', {
|
||||
'size': 'sm',
|
||||
'icon_left': 'check',
|
||||
'icon_right': 'info',
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
'default_option': __('message.choose_angel'),
|
||||
}) }}
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="col-auto">
|
||||
{{ f.submit(__('message.to_conversation'), {'btn_type': 'secondary'}) }}
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue