{% from "macros/box.html" import m_box %} {% macro m_vocabulary(voc) %} {%- set items = voc.query.all() %} {%- set voc_url = url_for('.vocabularies_model', group=voc.Meta.group or '_', Model=voc.Meta.name) %} {%- set m_voc_caller = caller %} {# save caller value of this macro for use inside m_box #} {%- call m_box(title=voc.Meta.label, href=voc_url) %} {%- if items %}
{%- else %}{{ _('No item in this vocabulary') }}
{%- endif %} {{ m_voc_caller() }} {%- endcall %} {% endmacro %}