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

{% set menu = 'admin_v2_keyword' %}


{% set script_controller = 'topxiaadminbundle/controller/keyword/list' %}

{% block main %}
  {{ web_macro.flash_messages() }}
  <form id="keyword-search-form" class="form-inline well well-sm" action="" method="get">
    <div class="form-group">
      <select class="form-control" name="state">
        {{ select_options(dict('state'), app.request.query.get('state'), 'admin.sensitive_manage.all_state_placeholder'|trans) }}
      </select>
    </div>
    <div class="form-group">
      <select class="form-control" name="searchKeyWord">
        {{ select_options(dict('searchKeyWord'), app.request.query.get('searchKeyWord')) }}
      </select>
    </div>
    <div class="form-group">
      <input type="text" id="keyword" name="keyword" class="form-control" value="{{  app.request.query.get('keyword')  }}" placeholder="{{'admin.sensitive_manage.search_keyword_placeholder'|trans}}">
    </div>
    <button class="btn btn-primary">{{'form.btn.search'|trans}}</button>

  </form>
  {% if keywords %}
    <table class="table table-striped table-hover" id="keyword-table" data-search-form="#keyword-search-form">
      <thead>
      <tr>
        <th>{{'admin.sensitive_manage.num'|trans}}</th>
        <th width="30%">{{'admin.sensitive_manage.sensitive'|trans}}</th>
        <th>{{'admin.sensitive_manage.type'|trans}}</th>
        <th>{{'admin.sensitive_manage.shield_times'|trans}}</th>
        <th>{{'admin.sensitive_manage.add_time'|trans}}</th>
        <th>{{'admin.sensitive_manage.operation'|trans}}</th>
      </tr>
      </thead>
      <tbody>
      {% for keyword in keywords %}
        {% include 'admin-v2/operating/sensitive/table-tr.html.twig' %}
      {% endfor %}
      </tbody>

    </table>
  {% else %}
    <div class="empty">{{'admin.sensitive_manage.empty'|trans}}</div>
  {% endif %}
  {{ admin_macro.paginator(paginator) }}
{% endblock %}
