{% extends 'base-admin.html.twig' %}

{% block content %}

{{ include('Admin/modals/dict.html.twig') }}

<div class="page-title">
  <div class="title_left">
    <h3>Dictionnaire</h3>
  </div>
</div>
<div class="clearfix"></div>


<div class="row">
    <div class="col-md-12">

              
                <div class="x_panel">
                  <div class="x_title">
                    <h2>Mots clés <small>définitions</small></h2>
                    
                    <div class="clearfix"></div>
                  </div>
                  <div class="x_content">
                    <table class="table table-hover"  id="dict-table">
                      <thead>
                        <tr>
                          <th>#</th>
                          <th>Type</th>
                          <th>Clé</th>
                          <th>Libellé</th>
                          <th>Actions</th>
                        </tr>
                      </thead>
                      <tbody>

                      {% for item in params %}
                        <tr>
                          <td scope="row">{{item.id}}</td>
                          
                          <td  class="type">{{item.ctab=='Q002'?'Question':'Reponse'}}</td>
                          <td  class="cle">{{item.cle}}</td>
                          <td  class="libelle">{{item.lib}}</td>
                          <td>
                            <button id="btn-edit"  row-id="{{ item.id }}" class="btn btn-small btn-info"><i class="fa fa-pencil"></i></button>
                            <button id="btn-delete" row-id="{{ item.id }}" class="btn btn-small btn-danger"><i class="fa fa-trash"></i></button>
                          </td>
                        </tr> 
                      {% else %}
                          <tr>
                          <td scope="row" colspan="4">Aucune correspondance trouvé !</td>
                          
                          
                        </tr> 
                      {%  endfor %}
                        
                       
                      </tbody>
                    </table>
                      {{ knp_pagination_render(params) }}
                  </div>
                </div>
              </div>

{% endblock %}


{% block script %}
<script>
$(document).ready(function(){
  DictController.init();
});
</script>
{% endblock %}