{% extends 'TopxiaWebBundle:CourseManage:layout.html.twig' %}

{% block title %}课程图片 - {{ parent() }}{% endblock %}

{% set side_nav = 'picture' %}
{% set script_controller = 'course-manage/picture' %}
{% block main %}

<div class="panel panel-default panel-col">
  <div class="panel-heading">
    课程图片
  </div>

  <div class="panel-body">
    <form id="course-picture-form" method="post" action="{{ path('course_manage_picture', {id:course.id}) }}" enctype="multipart/form-data">
      {{ web_macro.flash_messages() }}

      <div class="form-group clearfix">
        <div class="col-md-offset-2 col-md-8 controls">
          <img src="{{ default_path('coursePicture',course.largePicture, '') }}" />
        </div>
      </div>

      <div class="form-group clearfix">
        <div class="col-md-offset-2 col-md-8 controls">
          <input id="course-picture-field" type="file" name="picture" accept="image/gif,image/jpeg,image/png">

          <p class="help-block">你可以上传jpg, gif, png格式的文件, 图片建议尺寸至少为480x270。<br>文件大小不能超过<strong>2M</strong>。</p>

        </div>
      </div>

      <div class="form-group clearfix">
        <div class="col-md-offset-2 col-md-8 controls">
          <button class="btn btn-fat btn-primary" id="upload-picture-btn" type="submit">上传</button>
        </div>
      </div>

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

  </div>
</div>

{% endblock %}

