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

{% set modalSize = 'small' %}

{% block title %}{{ '%name%发放'|trans({'%name%':setting('reward_point').name|default('积分'|trans)}) }}{% endblock %}
{% block body %}
  <form id="reward-point-grant-form" class="form-horizontal" method="post"
        action="{{ url('admin_reward_point_grant', {id:user.id}) }}">
    <div class="row form-group">
      <div class="col-md-3 control-label">
        <label>{{ '用户名：'|trans }}</label>
      </div>
      <div class="col-md-8 controls pts">
        {{ user.nickname |default()}}
      </div>
    </div>
    <div class="row form-group">
      <div class="col-md-3 control-label pts">
        <label>{{ '当前余额：'|trans }}</label>
      </div>
      <div class="col-md-8 controls pts">
        <span>{{ account.balance|default(0) }}</span></div>
    </div>
    <div class="row form-group">
      <div class="col-md-3 control-label">
        <label for="amount">{{ '%name%值：'|trans({'%name%':setting('reward_point').name|default('积分'|trans)}) }}</label>
      </div>
      <div class="col-md-8 controls">
        <input type="text" id="amount" name="amount" class="form-control">
      </div>
    </div>
    <div class="row form-group">
      <div class="col-md-3 control-label">
        <label for="note">{{ '备注：'|trans }}</label>
      </div>
      <div class="col-md-8 controls">
        <input type="text" id="note" name="note" class="form-control">
      </div>
    </div>
    <input type="hidden" name="_csrf_token" value="{{ csrf_token('site') }}">
  </form>
{% endblock %}

{% block footer %}
  <button id="reward-point-grant-btn" data-submiting-text="{{ '正在提交'|trans }}" type="submit"
          class="btn btn-primary pull-right" data-toggle="form-submit"
          data-target="#reward-point-grant-form">{{ '确认'|trans }}</button>
  <button type="button" class="btn btn-link pull-right" data-dismiss="modal">{{ '取消'|trans }}</button>
  <script>app.load('reward-point/grant-modal');</script>
{% endblock %}