{{ header }}{{ column_left }}
<div id="content">
  <div class="page-header">
    <div class="container-fluid">
      <div class="pull-right"> <a href="{{ cancel }}" class="btn btn-primary"><i class="fa fa-reply"></i> {{ button_cancel }}</a> </div>
      <h1>{{ heading_title }}</h1>
      <ul class="breadcrumb">
        {% for breadcrumb in breadcrumbs %}
        <li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
        {% endfor %}
      </ul>
    </div>
  </div>
  <div class="container-fluid">
    {% if error  %}
    <div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> {{ error }}
      <button type="button" class="close" data-dismiss="alert">&times;</button>
    </div>
    {% endif %}
    {% if attention %}
    <div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> {{ attention }}
      <button type="button" class="close" data-dismiss="alert">&times;</button>
    </div>
    {% endif %}
    <div class="panel panel-default">
      <div class="panel-heading">
        <h3 class="panel-title"><i class="fa fa-pencil"></i> {{ text_refund }}</h3>
      </div>
      <div class="panel-body">
        <form action="{{ action }}" method="post" enctype="multipart/form-data" id="form" class="form-horizontal">
          <input type="hidden" name="amount_original" value="{{ amount_original }}"/>
          <input type="hidden" name="currency_code" value="{{ currency_code }}"/>
          <div class="form-group">
            <label class="col-sm-2 control-label" for="input-transaction-id">{{ entry_transaction_id }}</label>
            <div class="col-sm-10">
              <input type="text" name="transaction_id" value="{{ transaction_id }}" placeholder="{{ entry_transaction_id }}" id="input-transaction-id" class="form-control" readonly/>
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label">{{ entry_full_refund }}</label>
            <div class="col-sm-10">
              <input type="hidden" name="refund_full" value="0"/>
              <input type="checkbox" name="refund_full" id="refund_full" value="1" {% if refund_available %}checked="checked"{% endif %} onchange="refundAmount();"/>
            </div>
          </div>
          <div class="form-group"{% if not refund_available %}style="display:none;"{% endif %} id="partial_amount_row">
            <label class="col-sm-2 control-label">{{ entry_amount }}</label>
            <div class="col-sm-10">
              <input type="text" name="amount" value="{{ refund_available }}" placeholder="{{ entry_amount }}" class="form-control"/>
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label">{{ entry_message }}</label>
            <div class="col-sm-10">
              <textarea name="refund_message" id="paypal_refund_message" cols="40" rows="5"></textarea>
            </div>
          </div>
          <div class="pull-right"> <a onclick="$('#form').submit();" class="btn btn-primary">{{ button_refund }}</a> </div>
        </form>
      </div>
    </div>
  </div>
</div>
<script type="text/javascript"><!--
function refundAmount() {
  var valChecked = $('#refund_full').prop('checked');

  if (valChecked == true) {
    $('#partial_amount_row').hide();
  } else {
    $('#partial_amount_row').show();
  }
}
//--></script>
{{ footer }}