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

{% block title %}写私信 - {{ parent() }}{% endblock %}
{% set script_controller = 'message/create' %}
{% 
  set script_arguments = {
    followingMatchByNickname: path('following_match_bynickname')
  } 
%}

{% block content %}
<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="row row-8">
  <div class="col-md-8 col-md-offset-2">
    <div class="panel panel-default panel-page">
      <div class="panel-heading">
        <a href="{{ path('message')}}" class="btn btn-default pull-right">返回我的私信</a>
        <h2>写私信</h2>
      </div>

      <form id="message-create-form" class="form-horizontal" method="post">

        <div class="form-group">
          <div class="col-md-12 controls">
            {{ form_widget(form.receiver, {attr:{class:'form-control', placeholder:'收信人昵称', 'data-auto-url':script_arguments.followingMatchByNickname, 'data-url':path('message_check_receiver'), 'data-display':'收信人昵称'}})  }}
          </div>
        </div>

        <div class="form-group">
          <div class="col-md-12 controls">
            {{ form_widget(form.content, {attr:{class:'form-control', rows:5, placeholder:'想要说的话', 'data-display': '想要说的话'}}) }}
          </div>
        </div>

        <div class="form-group">
          <div class="col-md-12 controls">
            {{ form_rest(form) }}
            <input id="message-create-btn" class="btn btn-primary pull-right" type="submit" value="发送">
          </div>
        </div>

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


    </div><!-- /panel -->
  </div>
</div>

{% endblock %}