{% extends 'beltradar/base.html' %}
{% load i18n %}

{% block page_template_title %}
    {{ title }}
{% endblock page_template_title %}

{% block page_topic %}
    <h1 class="page-header text-center">
        {{ title }}
    </h1>
{% endblock page_topic %}

{% block aabeltradar_header %}
    <div class="card">
        <div class="card-header bg-primary rounded d-flex align-items-center">
            <h3>{% translate "View Session" %}</h3>
            <div class="px-2">
                {{ delete_button|safe }}
            </div>
        </div>
    </div>
{% endblock aabeltradar_header %}

{% block aabeltradar_block %}
    {% include 'beltradar/partials/view-session/session.html' %}
    {% include 'beltradar/partials/view-session/belt-timer-table.html' %}
    {% include 'beltradar/partials/view-session/survey-table.html' %}
    {% include 'beltradar/partials/view-session/charts.html' %}
{% endblock aabeltradar_block %}


{% block extra_css %}
    {% include 'bundles/datatables-2-css-bs5.html' %}
    {% include 'bundles/datatables-2-columncontrol-css-bs5.html' %}
    {% include 'beltradar/bundles/aa-beltradar-css.html' %}
{% endblock %}

{% block extra_javascript %}
    <script src="https://cdn.jsdelivr.net/npm/apexcharts"></script>
    <script>
        /**
         * Override settings for Belt Radar
         */
        const aaBeltRadarSettingsOverride = {
            url: {
                surveySessionEntry: "{% url 'beltradar:api:get_survey_entry' public_id=session.public_id %}",
                userBeltTimer: "{% url 'beltradar:api:get_session_belt_timer' public_id=session.public_id %}",
                index: "{% url 'beltradar:index' %}",
            },
            translations: {
                loading: "{% translate 'Loading...' %}",
                noData: "{% translate 'No mining chart data available.' %}",
                oreSurveyHeading: "{% translate 'Last Snapshot' %}",
                lastScan: "{% translate 'Last Scan' %}",
            }
        };
    </script>
    {% include 'beltradar/bundles/aa-beltradar-js.html' %}
    {% include 'beltradar/bundles/view-session-js.html' %}
    {% include 'bundles/datatables-2-js-bs5.html' %}
    {% include 'bundles/datatables-2-columncontrol-js-bs5.html' %}
    {% include "bundles/moment-js.html" with locale=True %}
        <!-- load modals -->
    {% include 'beltradar/partials/modals/request-accept-delete-belt-timer.html' %}
    {% include 'beltradar/partials/modals/request-accept-delete-survey-session.html' %}
    {% include 'beltradar/partials/modals/request-accept-delete-snapshot.html' %}
    {% include 'beltradar/partials/modals/request-add-survey.html' %}
    {% include 'beltradar/partials/modals/request-add-belt-timer.html' %}
{% endblock extra_javascript %}
