Поддержка аттрибутов в макросе b

master
Антон Касимов 2019-09-09 21:11:57 +03:00
parent 61ad931508
commit 217c11ad22
1 changed files with 2 additions and 5 deletions

View File

@ -1,8 +1,5 @@
{% macro b(class=None, tag="div", id=None) -%}
<{{ tag }}
{%- if class is not none %} class="{{class}}" {%- endif -%}
{%- if id is not none %} id="{{id}}" {%- endif -%}
>
{% macro b(tag="div", attributes=None) -%}
<{{ tag }}{% if attributes %} {{attributes|safe}}{%endif%}{% for name, value in kwargs.items() %} {{name}}="{{value}}"{% endfor -%}>
{%- if caller %}
{{ caller() }}
{% endif -%}