{# macro for generating tab bodies #}
{% macro create(prefix, isProfile, i18n) %}

	<div ng-controller="AjaxController">

		{% import "option/group.twig" as group %}
		{% set grouping = getOptionsGrouping() %}
		{% set isOnNetworkDashboard = isOnNetworkDashboard() %}

		{# Create all tab bodies #}
		{% for tabName, optionGroups in grouping %}
			{% if isOptionGroupVisible(optionGroups) %}
				{# Create a tab body #}
				{% set tabId = 'tab_body_' ~ prefix ~ '__' ~ loop.index0 %}

				{% if loop.first %}
					{% set style = '' %}
				{% else %}
					{% set style = 'display: none' %}
				{% endif %}

				{% set tabId = 'tab_body_' ~ prefix ~ '__' ~ loop.index0 %}

				<div id="{{ tabId }}" class="tab-body" style="{{ style }}"
					 ng-controller="{{ optionGroups.angular_controller|raw }}">
					{{ group.create(optionGroups, isProfile, i18n) }}
					{% if isOnNetworkDashboard %}
						<button class="button button-primary" busy-disabled="true" busy="{{ i18n.pleaseWait }}"
								not-busy-disabled="{{ '{{ isSaveDisabled }}' }}" ng-disabled="isSaveDisabled"
								ng-click="save()">{{ i18n.save }}</button><br><br>
						<div ng-hide="!isSaveDisabled" class="alert alert-danger" role="alert">
							<span>{{ i18n.haveToVerifyDomainConnection }}</span></div>
					{% else %}
						<button class="button button-primary" busy-disabled="true" busy="{{ i18n.pleaseWait }}"
								not-busy-disabled="{{ '{{ isSaveDisabled }}' }}"
								ng-disabled="(isSaveDisabled && permission.verification_username == 3 && permission.verification_password == 3)"
								ng-click="save()">{{ i18n.save }}</button><br><br>
						<div ng-hide="(!isSaveDisabled || permission.verification_username != 3 && permission.verification_password != 3)"
							 class="alert alert-danger" role="alert">
							<span>{{ i18n.haveToVerifyDomainConnection }}</span></div>
					{% endif %}
				</div>
			{% endif %}
		{% endfor %}
	</div>


{% endmacro %}