{# List school section #}

{% extends 'admin/_base_admin.html.twig' %}
{% set menu_section = true %}
{% block title %}Classe{% endblock %}
{% block content %}
    <div class="row">
        <div class="col-md-12">
            <div class="bgc-white bd bdrs-3 p-20 mB-20">
                <div class="row">
                    <div class="col-md-6">
                        <h4 class="c-grey-900 mB-20">Liste des matieres dans {{ class.name }}</h4>
                    </div>
                    <div class="col-md-6 text-right">
                        <a href="{{ path('class_subject_manage',{"classe":class.id }) }}"
                           class="btn btn-primary">Nouveau</a>
                    </div>
                </div>
                <table id="dataTable" class="table table-striped table-bordered" cellspacing="0" width="100%">
                    <thead>
                    <tr>
                        <th>Nom</th>
                        <th>professeur</th>
                        <th>Coefficient</th>
                        <th>Action</th>
                    </tr>
                    </thead>
                    <tfoot>
                    <tr>
                        <th>Nom</th>
                        <th>professeur</th>
                        <th>Coefficient</th>
                        <th>Action</th>
                    </tr>
                    </tfoot>
                    <tbody>
                    {% for subject in subjects %}
                        <tr>
                            <td>{{ subject.subject.name }}</td>
                            <td>{{ subject.profs ? subject.profs.user.username : '' }}</td>
                            <td>{{ subject.coefficient }}</td>
                            <td>
                                <a class="btn btn-outline-success btn-sm" title="Modifier"
                                   href="{{ path('class_subject_manage',{'classe':class.id,'id':subject.id}) }}">
                                    <i class="ti-pencil"></i>
                                </a>
                                <a class="btn btn-outline-danger btn-sm" title="Supprimer"
                                   href="{{ path('class_subject_remove',{'id':subject.id}) }}">
                                    <i class="ti-trash"></i>
                                </a>
                            </td>
                        </tr>
                    {% endfor %}
                    </tbody>
                </table>
            </div>
        </div>
    </div>
{% endblock %}