{% extends 'base.html' %}
{% load static %}

{% block content %}

    <div class="tab-content mt-2">
        <div id="app" class="tab-pane active">
            <div class="card">
                <div class="card-header">
                    <h5>{{ function.name }}</h5>
                </div>
                <div class="card-body">
                    <span class="spinner"></span>
                    <div id="card-wait-text">
                        Please wait...
                    </div>
                </div>
            </div>
        </div>
    </div>

{% endblock content %}

{% block javascript %}

    <script src="{% static 'js/analysis_app.bundle.js' %}"></script>
    <script>
        const params = new URLSearchParams(window.location.search);
        topobank.analysis_app.createAnalysisResultsDetailApp('#app', '{{ csrf_token }}', {
            functionId: {{ function.id }},
            functionName: '{{ function.name }}',
            visualizationType: '{{ visualization_type }}',
            subjects: params.get('subjects')
        });
    </script>

{% endblock javascript %}
