{# Student note #}

{% extends 'admin/_base_admin.html.twig' %}
{% set menu_section = true %}
{% block title %}Note étudiant{% 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 notes {{ student.user.username }} pendant la
                            session {{ session.name }}</h4>
                    </div>
                    <div class="col-md-6 text-right">
                        <a href="{{ path('student_note_manage',{"session":session.id,"student":student.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>Matiere</th>
                        <th>Coefficient</th>
                        <th>Note obténu</th>
                        <th>Total</th>
                        <td>Obsérvation</td>
                        {% if is_granted('ROLE_PROFS') %}
                            <th>Action</th>
                        {% endif %}
                    </tr>
                    </thead>
                    <tfoot>
                    <tr>
                        <th>Matiere</th>
                        <th>Coefficient</th>
                        <th>Note obténu</th>
                        <th>Total</th>
                        <td>Obsérvation</td>
                        {% if is_granted('ROLE_PROFS') %}
                            <th>Action</th>
                        {% endif %}
                    </tr>
                    </tfoot>
                    <tbody>
                    {% for note in notes %}
                        <tr>
                            <td>{{ note.matiere.subject.name }}</td>
                            <td>{{ note.matiere.coefficient }}</td>
                            <td>{{ note.note }}</td>
                            <td>{{ note.matiere.coefficient * note.note }}</td>
                            <td>{{ note.observation }}</td>
                            {% if is_granted('ROLE_PROFS') %}
                                <td>
                                    <a class="btn btn-outline-success btn-sm" title="Modifier"
                                       href="{{ path('student_note_manage',{"session":session.id,"student":student.id,'id':note.id}) }}">
                                        <i class="ti-pencil"></i>
                                    </a>
                                    <a class="btn btn-outline-danger btn-sm" title="Supprimer"
                                       href="{{ path('student_note_remove',{'id':note.id}) }}">
                                        <i class="ti-trash"></i>
                                    </a>
                                </td>
                            {% endif %}
                        </tr>
                    {% endfor %}
                    </tbody>
                </table>
            </div>
        </div>
    </div>
{% endblock %}