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

{% block title %}退款记录 - {{ parent() }}{% endblock %}
{% set main_nav = 'refunds' %}

{% block main_body %}

  {% if refunds %}
    <table class="table table-striped table-hover" id="refunds-table">
    	<thead>
    		<th>退款订单</th>
    		<th>退款申请时间</th>
    		<th>退款状态</th>
    	</thead>
    	<tbody>
    		{% for refund in refunds %}
    		  {% set order = orders[refund.orderId] %}
    		  <tr>
      		  <td>
              {% if order.targetType == 'course' %}
                <a href="{{ path('course_show', {id:order.targetId}) }}" target="_blank">{{ order.title }}</a>
              {% elseif order.targetType == 'vip' %}
        		    <a href="{{ path('vip', {id:order.targetId}) }}" target="_blank">{{ order.title }}</a>
              {% else %}
                {{ order.title }}
              {% endif %}
      		    <div class="text-sm text-muted">订单号：{{ order.sn }}</div>
      		  </td>
      		  <td>
      		  	{{ refund.createdTime|date('Y-n-d H:i') }}
      		  </td>
      		  <td>
      		    {{ dict_text('refundStatus:html', refund.status) }}
      		  </td>
    		  </tr>
    		{% endfor %}
  		</tbody>
  	</table>
    {{ web_macro.paginator(paginator) }} 
  {% else %}
    <div class="empty">没有退款记录</div>
  {% endif %}

{% endblock %}