{% 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 %}
{{ csrf.field() }} {%- if voc.Meta.group %} {%- endif %} {%- if edit_return_to %} {%- endif %} {%- for item in items %} {%- endfor %}
{{ _('Label') }} {{ _('Default') }} {{ _('Active') }}
{{ item.label|safe }} {%- if item.default %}{{ icon_checked }}{%- endif %} {%- if item.active %}{{ icon_checked }}{%- endif %}
{%- else %}

{{ _('No item in this vocabulary') }}

{%- endif %} {{ m_voc_caller() }} {%- endcall %} {% endmacro %}