{# Jinja2 Macros for CRUDLFA+ #} {% macro a(view, class='', iclass=True, text=True, next=False) -%} {{ view.material_icon }} {% if text == True %} {{ view.title_menu }} {% elif text %} {{ text }} {% endif %} {%- endmacro %} {% macro dropdown(views, id, icon='menu', text='', class='', iclass=False, next=False) -%} {% if views|length %} {% if views|length > 1 %} {% if icon %}{{ icon }}{% endif %} {{ text }} {% else %} {% for view in views %} {{ a(view, ' '.join([class, view.color|default('')]), iclass=iclass, next=next) }} {% endfor %} {% endif %} {% endif %} {%- endmacro %}