{% extends "course_flow/base.html" %}

{% load static i18n %}

{% block title %}
  {% trans "Explore" %} - CourseFlow
{% endblock %}

{% csrf_token %}

{% block scripts %}
  {{ block.super }}

  <script nonce="{{ request.csp_nonce }}">

    var library_renderer;
    const user_id = {{ user.id }};

    const disciplines_list = {{disciplines|safe}};

    const initial_workflows = {{initial_workflows|safe}};
    const initial_pages = {{initial_pages|safe}};

    window.addEventListener("load", function () {
      explore_renderer = new library_renderers.ExploreRenderer(disciplines_list, initial_workflows, initial_pages);
      $(document).ajaxError(renderers.fail_function);
      explore_renderer.render($("#container"));
      makeActiveSidebar("#panel-explore");
    });
  </script>

{% endblock %}
