templates/app/section/index.html.twig line 1
{% extends 'app/setting/index.html.twig' %} {% block title %} {% trans %}
Sections {% endtrans %} {% endblock %} {% block settingview %}
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-header">
<div class="row align-items-center">
<div class="col-md-6">
<div class="mb-3">
<h4 class="card-title font-size-20">
<i class="mdi mdi-update me-2"></i>
{% trans %} Sections {% endtrans %}
</h4>
</div>
</div>
<div class="col-md-6">
<div
class="d-flex flex-wrap align-items-center justify-content-end gap-2 mb-3"
>
<div>
<a
href="javascript:void(0)"
class="btn btn-primary"
data-bs-toggle="modal"
data-bs-target="#add-modal"
>
<i class="bx bx-plus me-1"></i>
{% trans %} Ajouter un nouveau {% endtrans %}
</a>
</div>
{% include "app/section/add-modal.html.twig" %} {% include
"app/section/edit-modal.html.twig" %}
</div>
</div>
</div>
</div>
<div class="card-body">
<div class="table-responsive">
<table id="datatable" class="table table-bordered mb-0">
<thead>
<tr>
<th>#</th>
<th>{% trans %} Nom de Section {% endtrans %}</th>
<th>{% trans %} Description {% endtrans %}</th>
<th>{% trans %} Tranche d'âge {% endtrans %}</th>
<th>{% trans %} Actions {% endtrans %}</th>
</tr>
</thead>
<tbody data-controller="section">
{% for section in sections %}
<tr>
<th scope="row">
{{ loop.index }}
</th>
<td>
{{ section.name }}
</td>
<td>
{{ section.description }}
</td>
<td>
{{ section.AgeRange | trans }}
</td>
<td>
<a
data-action="section#edit"
data-section-id="{{ section.id }}"
href="javascript:void(0)"
class="btn btn-info waves-effect waves-light me-2"
data-toggle="tooltip"
data-placement="top"
title="{{ 'Modifier' | trans }}"
>
<i class="bx bx-edit font-size-16 align-middle"></i>
</a>
{% if section.classrooms | length <= 0 %}
<form
style="display: contents"
id="delete-form-{{ section.id }}"
method="post"
action="{{
path('app_section_delete', { id: section.id })
}}"
onclick="alertify.set('notifier','position', 'top-right'); alertify.confirm('Supprimer', 'Voulez-vous vraiment supprimer cet objet?', function(e){ document.getElementById('delete-form-{{
section.id
}}').submit(); }, function(){ alertify.error('Annuler')});"
>
<input
type="hidden"
name="_token"
value="{{ csrf_token('delete' ~ section.id) }}"
/>
<a
href="javascript:void(0);"
type="button"
class="btn btn-danger waves-effect waves-light me-2"
data-toggle="tooltip"
data-placement="top"
title="{{ 'Supprimer' | trans }}"
>
<i class="bx bx-trash font-size-16 align-middle"></i>
</a>
</form>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
{% endblock %}