{% extends 'layout.html.twig' %}
{% do script(['libs/jquery-validation.js','libs/iframe-resizer-contentWindow.js',], 500) %}

{% block body %}
  <div class="tab-content" id="iframe-content">
    <div class="tab-pane js-course-tasks-pane active js-step2-view">
      <form class="form-horizontal" id="step2-form" >
        <div class="form-group">
          <div class="col-sm-2 control-label">
          <label for="title" class="control-label-required">{{ '标题名称'|trans }}</label>
          </div>
          <div class="col-sm-10">
            <input id="title" class="form-control" type="text" name="title" value="{{ activity.title|default('') }}" >
          </div>
        </div>
        {% block activity_content %}
        {% endblock %}
      </form>
    </div>
    <div class="tab-pane js-course-tasks-pane js-step3-view">
      <form class="form-horizontal" id="step3-form" >
        {% block activity_finish %}
        {% endblock %}

        {% set task = data('TaskByActivity', {courseId: activity.fromCourseId|default(0), activityId: activity.id|default(0)}) %}
        <div class="form-group">
          <div class="col-sm-10 col-sm-offset-2 radios">
            <label>
              <input type="checkbox" name="isOptional" value="1" {% if task.isOptional|default(false) or ( task is empty and optionalDefault|default(0)) %} checked {% endif %}>
              设为选修
            </label>
              <span class="color-gray">选修任务是否学习，不会影响下一任务的解锁，学习结果不会计入学习进度、学习统计中。在课程页面的目录中，将不会显示选修任务。</span>
          </div>
        </div>
      </form>
    </div>
  </div>
{% endblock %}
