{% comment %} Usage: used for creating multilanguage tabs Uses form, languages dictionary and field which will be in tabs Bootstrap for creating tabs {% endcomment %} {# This div creates tabs passing through languages dictionary #} {# Makes first tab active #}
{# Loops through languages and compare field+_languages.code with each form field #} {# display this field and makes first form field active #}
{% for code, name in languages %} {# makes field like field_en, field_ru etc. #} {% with field|add:"_"|add:code as lang_field %}
{% for f in form %} {# finds translated fields in form #} {% ifequal f.name lang_field %}
{{f}}{# style for making content border #} {{f.errors}}
{% endifequal %} {% endfor %}
{% endwith %} {% endfor %}