{% load cms_tags %}

{% with inline_styles=instance.inline_styles css_classes=instance.css_classes %}{% spaceless %}

<div id="cmsplugin_{{ instance.id }}"{% if css_classes %} class="{{ instance.css_classes }}"{% endif %}{% if inline_styles %} style="{{ inline_styles }}"{% endif %}>
	<ul class="nav nav-tabs" role="tablist">
	{% for pane in instance.child_plugin_instances %}
		<li role="presentation"{% if forloop.first %} class="active"{% endif %}>
			<a href="#cmsplugin_{{ pane.id }}" aria-controls="{{ pane.glossary.tab_title|lower }}" role="tab" data-toggle="tab">
			{{ pane.glossary.tab_title|safe }}
			</a>
		</li>
	{% endfor %}
	</ul>

	<div class="tab-content">
	{% for pane in instance.child_plugin_instances %}
		<div role="tabpanel" class="tab-pane{% if forloop.first %} active{% endif %}" id="cmsplugin_{{ pane.id }}">{% render_plugin pane %}</div>
	{% endfor %}
	</div>
</div>

{% endspaceless %}{% endwith %}
