Files
confient/lib/confient_web/templates/student/index.html.eex
2020-12-12 18:38:31 +01:00

33 lines
979 B
Elixir

<h1>Liste des élèves</h1>
<span><%= link "Ajouter un élève", to: Routes.student_path(@conn, :new) %></span> |
<span><%= link "Ajouter un lot d'élèves", to: Routes.student_path(@conn, :bulkform) %></span>
<hr>
<table>
<thead>
<tr>
<th>Prénom</th>
<th>Nom</th>
<th>Classe</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<%= for student <- @students do %>
<tr>
<td><%= student.lastname %></td>
<td><%= student.firstname %></td>
<td><%= link student.class.name, to: Routes.class_path(@conn, :show, student.class.id) %></td>
<td>
<span><%= link "Voir", to: Routes.student_path(@conn, :show, student) %></span>
<span><%= link "Editer", to: Routes.student_path(@conn, :edit, student) %></span>
<span><%= link "Supprimer", to: Routes.student_path(@conn, :delete, student), method: :delete, data: [confirm: "Vous êtes sur ?"] %></span>
</td>
</tr>
<% end %>
</tbody>
</table>