{% extends 'classroom-manage/layout.html.twig' %}
{% block title %}{{'classroom.set_manage'|trans}} - {{ parent() }}{% endblock %}
{% set side_nav = 'teachers' %}
{% do script(['app/js/classroom-manage/set-teachers/index.js']) %}
{% block main %}
<div class="panel panel-default panel-col">
  <div class="panel-heading">{{'classroom.set_teachers'|trans}}</div>
  <div class="panel-body">
    <form id="teachers-form" class="form-horizontal" method="post">
      {{ web_macro.flash_messages() }}
      {% if teacherIds %}
        <div class="form-group" id="teachers-form-group">
          <label class="col-md-2 control-label">
            {{'classroom.set_teacher'|trans}}
          </label>
          <div class="col-md-8 controls">
              <div id="classroom-manage-set-teachers" data-teachers={{ teacherItems|json_encode }}></div>
              <p class="help-block">
                {{'classroom.set_teacher_tips'|trans|raw}}
              </p>
          </div>
        </div>
        <div class="form-group">
          <div class="col-md-offset-2 col-md-8 controls">
            <input type="hidden" name="_csrf_token" value="{{ csrf_token('site') }}">
            <button type="submit" class="btn btn-fat btn-primary">{{'form.btn.save'|trans}}</button>
          </div>
        </div>
      {% else %}
      <div class="form-group empty">{{'classroom.set_teacher_empty'|trans}}</div>
      {% endif %}
    </form>
  </div>
</div>
{% endblock %}