<!-- extend base layout -->
{% extends "appbuilder/base.html" %}
{% import 'appbuilder/general/lib.html' as lib %}

{% block content %}
{{ lib.panel_begin(title) }}

{% if related_views %}
	<ul class="nav nav-tabs">  
	<li class="active"><a href="#Home" data-toggle="tab">Detail</a> </li>
        {% for view in related_views %}
		<li><a href="#{{view.__class__.__name__}}" data-toggle="tab">{{view.list_title}}</a></li>
        {% endfor %}
        </ul>
        
        <div class="tab-content">
        {% for view in related_views %}
        <div id="{{view.__class__.__name__}}" class="tab-pane">
		{{ widgets.get('related_lists')[loop.index - 1]()|safe }} 
	</div>
	{% endfor %}
{% endif %}


<div id="Home" class="tab-pane active">
	{{ widgets.get('show')()|safe }}
</div>

{% if related_views %} </div> {% endif %}
{{ lib.panel_end() }}

{% endblock %}


