<%! from django.utils.translation import ugettext as _ %>
<%! from django.core.urlresolvers import reverse %>

<%inherit file="/main.html" />
<%namespace name='static' file='/static_content.html'/>

## ----- Tips on adding something to the new instructor dashboard -----
## 1. add your input element, e.g. in instructor_dashboard2/data_download.html
##   the input includes a reference like data-endpoint="${ section_data['get_anon_ids_url'] }"
## 2. Go to the old dashboard djangoapps/instructor/views/instructor_dashboard.py and
##   add in a definition of 'xxx_url' in the right section_data for whatever page your
##   feature is on.
## 3. Add a url() entry in api_urls.py
## 4. Over in lms/static/coffee/src/instructor_dashboard/ there there are .coffee files
##   for each page which define the .js. Edit this to make your input do something
##   when clicked. The .coffee files use the name=xx to pick out inputs, not id=
## 5. Implement your standard django/python in lms/djangoapps/instructor/views/api.py
## 6. And tests go in lms/djangoapps/instructor/tests/

<%block name="pagetitle">${_("Instructor Dashboard")}</%block>
<%block name="nav_skip">#instructor-dashboard-content</%block>

<%block name="headextra">
  <%static:css group='style-course-vendor'/>
  <%static:css group='style-course'/>
  <script type="text/javascript" src="${static.url('js/vendor/underscore-min.js')}"></script>
  <script type="text/javascript" src="${static.url('js/vendor/mustache.js')}"></script>
  <script type="text/javascript" src="${static.url('js/vendor/flot/jquery.flot.js')}"></script>
  <script type="text/javascript" src="${static.url('js/vendor/flot/jquery.flot.axislabels.js')}"></script>
  <script type="text/javascript" src="${static.url('js/vendor/jquery-jvectormap-1.1.1/jquery-jvectormap-1.1.1.min.js')}"></script>
  <script type="text/javascript" src="${static.url('js/vendor/jquery-jvectormap-1.1.1/jquery-jvectormap-world-mill-en.js')}"></script>
  <script type="text/javascript" src="${static.url('js/course_groups/cohorts.js')}"></script>
  <script type="text/javascript" src="${static.url('js/vendor/jquery.event.drag-2.2.js')}"></script>
  <script type="text/javascript" src="${static.url('js/vendor/jquery.event.drop-2.2.js')}"></script>
  <script type="text/javascript" src="${static.url('js/vendor/slick.core.js')}"></script>
  <script type="text/javascript" src="${static.url('js/vendor/slick.grid.js')}"></script>
  <link rel="stylesheet" href="${static.url('css/vendor/slickgrid/smoothness/jquery-ui-1.8.16.custom.css')}">
  <link rel="stylesheet" href="${static.url('css/vendor/slickgrid/slick.grid.css')}">
  <script type="text/javascript" src="${static.url('js/vendor/codemirror-compressed.js')}"></script>
  <script type="text/javascript" src="${static.url('js/vendor/tiny_mce/tiny_mce.js')}"></script>
  <script type="text/javascript" src="${static.url('js/vendor/tiny_mce/jquery.tinymce.js')}"></script>
  <%static:js group='module-descriptor-js'/>
  <%static:js group='instructor_dash'/>
</%block>

## NOTE that instructor is set as the active page so that the instructor button lights up, even though this is the instructor_2 page.
<%include file="/courseware/course_navigation.html" args="active_page='instructor'" />

<style type="text/css"></style>

<script language="JavaScript" type="text/javascript"></script>

<section class="container">
<div class="instructor-dashboard-wrapper-2">
<div class="olddash-button-wrapper"><a href="${ old_dashboard_url }"> ${_("Back to Standard Dashboard")} </a></div>
%if studio_url:
  ## not checking access because if user can see this, they are at least course staff (with studio edit access)
  <div class="studio-edit-link"><a href="${studio_url}" target="_blank">${_('Edit Course In Studio')}</a></div>
%endif
<section class="instructor-dashboard-content-2" id="instructor-dashboard-content">

  <h1>${_("Instructor Dashboard")}</h1>
  <hr />
  ## links which are tied to idash-sections below.
  ## the links are acativated and handled in instructor_dashboard.coffee
  ## when the javascript loads, it clicks on the first section
  <h2 class="instructor-nav">
    % for section_data in sections:
      <a href="" data-section="${ section_data['section_key'] }">${_(section_data['section_display_name'])}</a>
    % endfor
  </h2>

  ## each section corresponds to a section_data sub-dictionary provided by the view
  ## to keep this short, sections can be pulled out into their own files

  % for section_data in sections:
    <section id="${ section_data['section_key'] }" class="idash-section">
      <%include file="${ section_data['section_key'] }.html" args="section_data=section_data" />
    </section>
  % endfor

</section>
</div>
</section>
