{% extends 'admin/layout.html.twig' %}

{% set menu = 'admin_reward_point_account' %}

{% block main %}
  <form id="keyword-search-form" class="form-inline well well-sm" action="" method="get">
    <div class="form-group">
      <select id="keywordType" name="keywordType" class="form-control">
        {{ select_options(dict('rewardPointUserType'), app.request.query.get('keywordType') ? app.request.query.get('keywordType') : 'nickname') }}
      </select>
    </div>
    <div class="form-group">
      <input type="text" id="keyword" name="keyword" class="form-control"
             value="{{ app.request.query.get('nickname') }}" placeholder="{{ '搜索用户名/姓名'|trans }}">
    </div>
    <button class="btn btn-primary">{{ '搜索'|trans }}</button>
  </form>
  <table class="table table-striped table-hover" id="keyword-table" data-search-form="#keyword-search-form">
    <thead>
      <tr>
        <th width="15%">{{ '用户名'|trans }}</th>
        <th width="10%">{{ '姓名'|trans }}</th>
        <th width="10%">{{ '当前%name%'|trans({'%name%':setting('reward_point').name|default('积分'|trans)}) }}</th>
        <th width="10%">{{ '累计消耗'|trans }}</th>
        <th width="20%">{{ '手机号'|trans }}</th>
        <th width="25%">{{ '邮箱'|trans }}</th>
        <th width="10%">{{ '操作'|trans }}</th>
      </tr>
    </thead>
    <tbody>
      {% if users|default() %}
        {% for user in users %}
          {% include 'admin/reward-point/table-tr.html.twig' %}
        {% endfor %}
      {% else %}
        <tr><td colspan="20"><div class="empty">{{'暂无账户信息!'|trans}}</div></td></tr>
      {% endif %}
    </tbody>
  </table>
  {{ web_macro.paginator(paginator) }}
{% endblock %}