{% extends 'course-manage/layout.html.twig' %}

{% block title %}{{'course.teacher_setup'|trans}} - {{ course.title }} - {{ parent() }}{% endblock %}
{% set course_side_nav = 'teachers' %}
{% do script(['libs/jquery-validation.js','app/js/course-manage/teachers/index.js']) %}

{% block page_title %}{{ 'course.teacher_setup'|trans }}{% endblock %}

{% block main_body %}
  <div>
    <form id="teachers-form" class="form-horizontal" method="post" >
      {{ web_macro.flash_messages() }}
      <div class="form-group" id="teachers-form-group">
        <div class="col-md-2 control-label"><label>{{'course.teacher_setup.exist_teacher'|trans}}</label></div>
        <div class="col-md-8 controls">
          <div id="course-teachers" data-field-name="teachers" data-init-value="{{teacherIds|json_encode}}" data-query-url="{{path('course_set_manage_course_teachers_match', {courseSetId: courseSet.id, courseId: course.id})}}"></div>
          <div class="help-block">{{'course.teacher_setup.exist_teacher.add_tips'|trans}}</div>
        </div>
      </div>
      <div class="form-group">
        <div class="col-md-offset-2 col-md-8 controls">
          <button type="button" class="cd-btn cd-btn-primary js-btn-save">{{'form.btn.save'|trans}}</button>
        </div>
      </div>
      <input type="hidden" name="_csrf_token" value="{{ csrf_token('site') }}">
    </form>
  </div>
{% endblock %}
