{% extends "courses/base-course.html" %}
{% load i18n %}
{% load dashboard_extras %}

{% block view-name %}view-dashboard{% endblock view-name %}

{% block child_content %}
  <section class="view-section">
    {% block content_nav %}
    {% endblock %}

    {% block module_meta %}
    {% endblock %}

    {% if js_data.course.hasData %}
      <div class="section-content section-data-graph">
        <div class="section-content section-data-viz">
          <div class="analytics-chart-container">
            {% block chart_info %}{% endblock %}
            {% captureas chart_tip_text %}{% block chart_tip_text %}{% endblock %}{% endcaptureas %}
            {% include "chart_tooltip.html" with tip_text=chart_tip_text track_category="bar" %}
            <div id="chart-view" class="analytics-chart"
              data-track-type="hover" data-track-event="edx.bi.graph.interacted"
              data-track-category="{% block hover_category %}{% endblock %}">
                {% include "loading.html" %}
            </div>
          </div>
          {% block module_controls %}
          {% endblock %}
        </div>
      </div>
    {% else %}
      {% include "alert_information.html" with message=no_data_message %}
    {% endif %}

  </section>

  {% block metric_cards %}{% endblock %}

  {% if js_data.course.hasData %}
    <section class="view-section">

    <div class="section-heading section-data-table-title">
      <h4 class="section-title">{% block table_title %}{% endblock %}</h4>
      {% block table_download %}{% endblock %}
    </div>

    {% if js_data.course.primaryContent %}
      <div class="section-content section-data-table" data-role="data-table">
        {% include "loading.html" %}
      </div>
    {% else %}
      {% show_table_error %}
    {% endif %}
    </section>
  {% endif %}
{% endblock %}
