{% extends 'layout/backEndLayout.html.twig' %}
{% block content %}
<div class="row">
<div class="col-lg-2" >
<div class="btn-group record_actions m-2">
{% if is_granted('ROLE_ADMIN') %}
<a class="btn btn-info" href="{{ path('admin_courses') }}">
<i class="fa fa-list"></i> {{ 'Back to the list'|trans({}, 'admin') }}
</a>
{% endif %}
</div>
</div>
<div class="col-lg-10 jumbotron">
<article class="p-3" >
<div class="container">
<div class="card-deck mb-3 text-center">
<div class="card mb-4 box-shadow">
<div class="card-header">
<h4 class="my-0 font-weight-normal">{{course.wording}}</h4>
</div>
<div class="card-body">
<div>
<ul class="list-unstyled h3 mt-3 mb-4">
<li>{{course.coefficient}}</li>
<li>{{course.code}}</li>
<li>{{course.module.name}}</li>
<li>{{course.domain.name}}</li>
</ul>
<div class=" ">
{% if is_granted('ROLE_ADMIN') %}
<a class="btn btn-outline-warning" href="{{path('admin_courses_edit', {id: course.id})}}"> <i class="fa fa-pencil-square-o" aria-hidden="true"></i>Edit </a> |
<a class="btn btn-outline-danger" href="#" onclick= "event.preventDefault() ; confirm('Are you sure ?') && document.getElementById('js-course-delete-form').submit();"> <i class="fa fa-trash"></i> Delete</a>
<form id="js-course-delete-form" action="{{path('admin_courses_delete', {id: course.id})}}" method="post" style="display: none;">
<input type="hidden" name="csrf_token" value="{{ csrf_token('courses_deletion' ~ course.id ) }}" id="">
<input type="hidden" name="_method" value="DELETE">
</form>
{% endif %}
</div>
</div>
<div>
<h5 class="card-title list-unstyled h3 mt-3 mb-4">Historique des attributions</h5>
<table class="table table-striped">
<thead>
<tr>
<th scope="col">Annee scolaire</th>
<th scope="col">Enseignant</th>
<th scope="col">Titulaire</th>
</tr>
</thead>
<tbody>
{% for attribution in course.attributions|reverse %}
<tr>
<td>{{attribution.schoolYear}}</td>
<td>{{attribution.teacher}}</td>
<td>{{attribution.headTeacher}}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
</article>
</div>
</div>
{% endblock %}