{% extends 'TopxiaAdminBundle:User:layout.html.twig' %}

{% block title %}家长管理 - {{ parent() }}{% endblock %}

{% set menu = 'parent' %}

{% set script_controller = 'parent/list' %}

{% block main %}
<div class="page-header clearfix">
  <button class="btn btn-info btn-sm pull-right mls" id="add-navigation-btn" data-toggle="modal" data-target="#modal" data-url="{{path('admin_parent_create')}}" >添加</button>
    <a class="btn btn-info btn-sm pull-right" href="{{ path('admin_user_import_check',{type:'parent'}) }}">导入</a>
  <h1 class="pull-left">家长管理</h1>
</div>
<form id="user-search-form" class="form-inline well well-sm" action="" method="get" novalidate>
  <div class="form-group">
    <input type="text" id="class_name" name="class_name" data-url="{{path('admin_class_list')}}" class="form-control" value="{{ app.request.query.get('class_name') }}" placeholder="按班级">
    
    <input type="hidden" id="class_id" name="class_id" class="form-control" value="{{ app.request.query.get('class_id') }}" >
  </div>
  <div class="form-group">
    <select id="keywordType" name="keywordType" class="form-control">
      {{ select_options(dict('parentKeyWordType'), app.request.query.get('keywordType'), '--关键词类型--') }}
    </select>
  </div>

  <div class="form-group">
    <input type="text" id="keyword" name="keyword" class="form-control" value="{{ app.request.query.get('keyword') }}" placeholder="关键词">
  </div>

  <button class="btn btn-primary">搜索</button>
</form>

<table id="user-table" class="table table-striped table-hover" data-search-form="#user-search-form">
  <thead>
    <tr>
      <th>姓名</th>
      <th>子女姓名</th>
      <th>所属班级</th>
      <th>家庭关系</th>
      <th>手机号码</th>
      <th>最近登录</th>
      <th>操作</th>
    </tr>
  </thead>
  <tbody>
    {% for user in users %}
      {% set relations = userRelations[user.id]|default(null) %}
      {% include 'TopxiaAdminBundle:Parent:parent-table-tr.html.twig' with {user:user} %}
    {% endfor %}
  </tbody>
</table>
 {{ web_macro.paginator(paginator) }} 
{% endblock %}