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

{% block title %}{% trans %}title_directory_view{% endtrans %} : #{{ directory.id }} - {{ directory.fullname }}{% endblock %}

{% block body %}  
  <div class="row">
    <div class="col-12 col-xl-6">
            
      <h4>{% trans %}title_certificate{% endtrans %} {% if is_granted('create', classMetadataToEntity(directory.certificates.typeClass, app.user)) %} <a href="{{ path('document_create_directory', {type: 'certificate', directory: directory.id}) }}"><span class="badge rounded-pill bg-success"><i class="fa fa-plus"></i> {% trans %}button_create{% endtrans %}</span></a> {% endif %}</h4>
      {% include '_cells/documentTable.html.twig' with {'documents': Certificate, notype: true, limit: 3, nodirectoryinfo: true,} %}
      <hr class="my-3">

      <h4>{% trans %}title_complaint{% endtrans %} {% if is_granted('create', classMetadataToEntity(directory.complaints.typeClass, app.user)) %} <a href="{{ path('document_create_directory', {type: 'complaint', directory: directory.id}) }}"><span class="badge rounded-pill bg-success"><i class="fa fa-plus"></i> {% trans %}button_create{% endtrans %}</span></a> {% endif %}</h4>
      {% include '_cells/documentTable.html.twig' with {'documents': Complaint, notype: true, limit: 3, nodirectoryinfo: true} %}    
      <hr class="my-3">

      <h4>{% trans %}title_licencewithdrawals{% endtrans %} {% if is_granted('create', classMetadataToEntity(directory.licencewithdrawals.typeClass, app.user)) %} <a href="{{ path('document_create_directory', {type: 'licencewithdrawal', directory: directory.id}) }}"><span class="badge rounded-pill bg-success"><i class="fa fa-plus"></i> {% trans %}button_create{% endtrans %}</span></a> {% endif %}</h4>
      {% include '_cells/documentTable.html.twig' with {'documents': Licencewithdrawal, notype: true, limit: 3, nodirectoryinfo: true} %}     
      <hr class="my-3">
      
      <h4>{% trans %}title_infringements{% endtrans %} {% if is_granted('create', classMetadataToEntity(directory.infringements.typeClass, app.user)) %} <a href="{{ path('document_create_directory', {type: 'infringement', directory: directory.id}) }}"><span class="badge rounded-pill bg-success"><i class="fa fa-plus"></i> {% trans %}button_create{% endtrans %}</span></a> {% endif %}</h4>
      {% include '_cells/documentTable.html.twig' with {'documents': Infringement, notype: true, limit: 3, nodirectoryinfo: true} %}    
      <hr class="my-3">

      <h4>{% trans %}title_jails{% endtrans %} {% if is_granted('create', classMetadataToEntity(directory.jails.typeClass, app.user)) %} <a href="{{ path('document_create_directory', {type: 'jail', directory: directory.id}) }}"><span class="badge rounded-pill bg-success"><i class="fa fa-plus"></i> {% trans %}button_create{% endtrans %}</span></a> {% endif %}</h4>
      {% include '_cells/documentTable.html.twig' with {'documents': Jail, notype: true, limit: 3, nodirectoryinfo: true} %}      
      <hr class="my-3">

      <h4>{% trans %}title_bracelets{% endtrans %} {% if is_granted('create', classMetadataToEntity(directory.bracelets.typeClass, app.user)) %} <a href="{{ path('document_create_directory', {type: 'bracelet', directory: directory.id}) }}"><span class="badge rounded-pill bg-success"><i class="fa fa-plus"></i> {% trans %}button_create{% endtrans %}</span></a> {% endif %}</h4>
      {% include '_cells/documentTable.html.twig' with {'documents': Bracelet, notype: true, limit: 3, nodirectoryinfo: true} %}      
      <hr class="my-3">

      <h4>{% trans %}title_criminals{% endtrans %} {% if is_granted('create', classMetadataToEntity(directory.criminals.typeClass, app.user)) %} <a href="{{ path('document_create_directory', {type: 'criminal', directory: directory.id}) }}"><span class="badge rounded-pill bg-success"><i class="fa fa-plus"></i> {% trans %}button_create{% endtrans %}</span></a> {% endif %}</h4>
      {% include '_cells/documentTable.html.twig' with {'documents': Criminal, notype: true, limit: 3, nodirectoryinfo: true} %}      
      <hr class="my-3">

      <h4>{% trans %}title_stolen_vehicles{% endtrans %} {% if is_granted('create', classMetadataToEntity(directory.stolenvehicles.typeClass, app.user)) %} <a href="{{ path('document_create_directory', {type: 'stolenvehicle', directory: directory.id}) }}"><span class="badge rounded-pill bg-success"><i class="fa fa-plus"></i> {% trans %}button_create{% endtrans %}</span></a> {% endif %}</h4>
      {% include '_cells/documentTable.html.twig' with {'documents': Stolenvehicle, notype: true, limit: 3, nodirectoryinfo: true} %}
      <hr class="my-3">     
      
      <h4>{% trans %}title_medicals{% endtrans %} {% if is_granted('create', classMetadataToEntity(directory.medicals.typeClass, app.user)) %} <a href="{{ path('document_create_directory', {type: 'medical', directory: directory.id}) }}"><span class="badge rounded-pill bg-success"><i class="fa fa-plus"></i> {% trans %}button_create{% endtrans %}</span></a> {% endif %}</h4>
      {% include '_cells/documentTable.html.twig' with {'documents': Medical, notype: true, limit: 3, nodirectoryinfo: true} %}
      <hr class="my-3">      
      

    </div>

    <div class="col-12 col-xl-6">
      {% include '_cells/directoryCard.html.twig' with {'directory': directory} %}      
    </div>
  </div>  
{% endblock %}
