{% extends 'TopxiaWebBundle::bootstrap-modal-layout.html.twig' %}

{% block title %}发送私信{% endblock %}

{% block body %}
  <form id="message-create-form" class="form-horizontal" method="post" action="{{ path('message_create', {toId:userId}) }}">
    {# {{ form_errors(form) }} #}

    <div class="form-group">
      <div class="col-md-2 control-label">{{ form_label(form.receiver, '收件人') }}</div>
      <div class="col-md-10 controls">
        {{ form_widget(form.receiver, {attr:{class:'form-control', rows:1,'data-url':path('message_check_receiver') }})  }}
      </div> 
    </div>

    <div class="form-group">
      <div class="col-md-2 control-label">{{ form_label(form.content, '内容') }}</div>
      <div class="col-md-10 controls">
        {{ form_widget(form.content, {attr:{class:'form-control',rows:5}}) }}
      </div>
    </div>

    <div class="form-group">
      <div class="col-md-offset-2 col-md-10 controls">
        {{ form_rest(form) }}
        <button class="btn btn-primary" type="submit">发送</button>
      </div>
    </div>

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

  <script> app.load('user/message-send-modal'); </script>
{% endblock %}

{% set hide_footer = true %}