{% extends 'open-course-manage/layout.html.twig' %}
{% block title %}{{'直播时间设置'|trans}} - {{ parent() }}{% endblock %}
{% set side_nav = 'liveTimeSet' %}
{% do script(['libs/jquery-validation.js',
'libs/bootstrap-datetimepicker.js',
'app/js/open-course-manage/live-open-time-set/index.js']) %}

{% block main %}

<style>

.ui-autocomplete {
    border:1px solid #ccc;
    background-color: #FFFFFF;
    box-shadow: 2px 2px 3px #EEEEEE;
}
.ui-autocomplete-ctn{
    margin:0;
    padding:0;
}
.ui-autocomplete-item {
    width: 180px;
    overflow:hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 30px;
    padding:0 10px 0 10px;
    cursor: default;
}
.ui-autocomplete-item-hover {
    background:#f2f2f2;
}
.ui-autocomplete-item-hl {
    background:#F6FF94;
}

</style>

<div class="panel panel-default panel-col">
  <div class="panel-heading">{{'直播时间设置'|trans}}</div>
  <div class="panel-body">
    <form class="form-horizontal" id="live-open-course-form" method="post">

      {{ web_macro.flash_messages() }}

      <div class="form-group">
        <label class="col-md-2 control-label" for="live-startTime">{{'直播开始时间'|trans}}</label>
        <div class="col-md-8 controls" style="z-index:2000;">
          <input type="text" id="live-startTime"  name="startTime" class="form-control width-input width-input-large" value="{% if openLiveLesson %}{{ openLiveLesson.startTime|date('Y-m-d H:i:s') }}{% endif %}">
          <div class="help-block" id="starttime-help-block">
            {{'教师可在直播开始前1小时内进入直播教室，以准备相关教学资料。'|trans}}
          </div>
        </div>
      </div>

      <div class="form-group">
        <label class="col-md-2 control-label" for="live-length-field">{{'直播时长'|trans}}</label>
        <div class="col-md-8 controls">
          <input type="text"  name="timeLength" id="live-length-field" class="form-control width-input width-input-large" value="{{ openLiveLesson.length|default(60) }}" placeholder="时长" data-calculate-left-capacity-url="" data-max-Student-Num = ""  data-url="{% if openLiveLesson|default(null) %}{{path('live_open_lesson_time_check',{courseId:course.id,lessonId:openLiveLesson.id}) }}{% else %}{{path('live_open_lesson_time_check',{courseId:course.id})}}{% endif %}" > {{'分钟'|trans}}
          <div class="help-block" id="timelength-help-block"></div>
        </div>

        <input type="hidden" id="live_lesson_time_check" data-url="{% if openLiveLesson|default(null) %}{{path('live_open_lesson_time_check',{courseId:course.id,lessonId:openLiveLesson.id}) }}{% else %}{{path('live_open_lesson_time_check',{courseId:course.id})}}{% endif %}" />
      </div>

      <div class="form-group">
        <div class="col-md-offset-2 col-md-8 controls">
            <button class="btn btn-fat btn-primary" id="live-open-course-form-btn" type="submit"
            data-submiting-text="{{'正在保存...'|trans}}">{{'保存'|trans}}</button>
        </div>
      </div>

      <input type="hidden" name="_csrf_token" value="{{ csrf_token('site') }}">

    </form>
  </div>
</div>

{% endblock %}