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

{% set post = post|default(null) %}

{% block title %}{% if post %}编辑帖子{% else %}回复帖子{% endif %} - {{ parent() }}{% endblock %}

{% set script_controller = 'class-thread/post-edit' %}

{% block class_main %}

<ul class="breadcrumb">
  <li class="active">编辑帖子</li>
</ul>

<form id="thread-post-form" method="post"
    action="{{ path('class_thread_post_edit', {classId:post.classId, threadId:post.threadId, postId:post.id}) }}"
  >
  <div class="form-group">
    <div class="controls">
       <textarea id="post-content-field" class="form-control" name="content" rows="15" placeholder="正文">{{ post.content|default('') }}</textarea>
    </div>
  </div>
  <div class="form-group">
    <div class="controls clearfix">
      <button type="submit" class="btn btn-primary pull-right">发表</button>
      <a href="{{ path('class_threads', {classId:post.classId}) }}" class="btn btn-link pull-right">取消</a>
      <input type="hidden" name="_csrf_token" value="{{ csrf_token('site') }}">
    </div>
  </div>

</form>

{% endblock %}
