{% extends 'old-bootstrap-modal-layout.html.twig' %}
{% set order = order|default(null) %}

{% block title %}
  {% if order.status == 'finished' %}{{'编辑发货留言'|trans}}{% else %}{{'确认发货'|trans}}{% endif %}
{% endblock %}

{% block body %}

  <form class="form-horizontal" id="message-form" {% if order.status == 'finished' %} action="{{ path('admin_reward_point_exchange_message_update', {id:order.id}) }}" data-flag="edit" {% else %} action="{{ path('admin_reward_point_exchange_deliver', {id:order.id}) }}" data-flag="add" {% endif %} method="post">
    <div class="form-group">
      <label class="col-md-3 control-label" for="exchange-message-field">{{'发货留言：'|trans}}</label>
      <div class="col-md-6 controls">
        <input class="form-control" id="exchange-message-field" type="text" name="message" placeholder="{{ '最多50个字符'|trans }}" value="{{ order.message }}">
      </div>
    </div>
    <input type="hidden" name="_csrf_token" value="{{ csrf_token('site') }}">
  </form>
  <script type="text/javascript">app.load('reward-point-mall/exchange-confirm-modal');</script>
{% endblock %}

{% block footer %}
  <button type="button" class="btn btn-link" data-dismiss="modal">{{'取消'|trans}}</button>
  <button id="exchange-order-btn" data-submitting-text="{{'正在提交'|trans}}" type="submit" class="btn btn-primary" data-toggle="form-submit" data-target="#message-form">{{'确认'|trans}}</button>
{% endblock %}
