Merge pull request #15 in WFCC/cc34 from 13-page-apprentis-inscrit to master

* commit 'b8be103298773351b315370040fe3bf2fe63db4d':
  Ajout liste des apprentis inscits à un atelier pour question 13
  Ajout apprenti voir ses inscription pour question 13
This commit is contained in:
Benjaballah Zakarya 2023-02-09 11:47:38 +01:00
commit b53a794585
4 changed files with 66 additions and 0 deletions

View File

@ -34,6 +34,16 @@ class AtelierController extends AbstractController
]); ]);
} }
#[IsGranted('ROLE_APPRENTI')]
#[Route('/inscrit', name: 'app_atelier_inscrit', methods: ['GET'])]
public function index_inscrit(AtelierRepository $atelierRepository, MarkdownAtelier $markdown): Response
{
$ateliers = $this->getUser()->getFormationsSuivies()->toArray();
return $this->render('atelier/index_inscrit.html.twig', [
'ateliers' => $markdown->parseArray($ateliers),
]);
}
#[IsGranted('ROLE_INSTRUCTOR')] #[IsGranted('ROLE_INSTRUCTOR')]
#[Route('/new', name: 'app_atelier_new', methods: ['GET', 'POST'])] #[Route('/new', name: 'app_atelier_new', methods: ['GET', 'POST'])]
public function new(Request $request, AtelierRepository $atelierRepository): Response public function new(Request $request, AtelierRepository $atelierRepository): Response

View File

@ -0,0 +1,41 @@
{% extends 'base.html.twig' %}
{% block title %}Atelier suivis{% endblock %}
{% block body %}
<h1>Liste des Atelier suivis</h1>
{% if (ateliers | length) > 0 %}
<table class="table">
<thead>
<tr>
<th scope="row">Id</th>
<th scope="col">Nom</th>
<th class="" scope="col">Description</th>
<th scope="col">Actions</th>
</tr>
</thead>
<tbody>
{% for atelier in ateliers %}
<tr>
<td>{{ atelier.id }}</td>
<td>{{ atelier.nom }}</td>
<td>{{ atelier.description | raw }}</td>
<td>
<div class="d-flex flex-row align-content-end">
<a class="btn btn-outline-primary m-1"
href="{{ path('app_atelier_show', {'id': atelier.id}) }}">Afficher</a>
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<div class="alert alert-info" role="alert">
Il n'y a pas encore d'ateliers. Vous pouvez commencer par <a class="alert-link"
href="{{ path('app_atelier_index') }}">en suivre un !</a>
</div>
{% endif %}
{% endblock %}

View File

@ -23,6 +23,16 @@
<th>Email instructeur</th> <th>Email instructeur</th>
<td>{{ atelier.instructeur.email }}</td> <td>{{ atelier.instructeur.email }}</td>
</tr> </tr>
<tr>
<th>Elèves inscrits</th>
<td>
<ul>
{% for eleve in atelier.eleves %}
<li>{{ eleve.prenom }} {{ eleve.nom }} - {{ eleve.email }}</li>
{% endfor %}
</ul>
</td>
</tr>
</tbody> </tbody>
</table> </table>

View File

@ -18,6 +18,11 @@
<a class="nav-link" href="{{ path('app_atelier_by_me') }}">Mes Ateliers</a> <a class="nav-link" href="{{ path('app_atelier_by_me') }}">Mes Ateliers</a>
</li> </li>
{% endif %} {% endif %}
{% if app.user %}
<li class="nav-item">
<a class="nav-link" href="{{ path('app_atelier_inscrit') }}">Mes Formations</a>
</li>
{% endif %}
</ul> </ul>
</div> </div>
{% if app.user %} {% if app.user %}