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

30 lines
748 B
Elixir

<h1>Liste des classes</h1>
<span><%= link "Ajouter une classe", to: Routes.class_path(@conn, :new) %></span>
<hr>
<table>
<thead>
<tr>
<th>Nom</th>
<th>Nombre d'élèves</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<%= for class <- @classes do %>
<tr>
<td><%= class.name %></td>
<td><%= length(class.students) %></td>
<td>
<span><%= link "Voir", to: Routes.class_path(@conn, :show, class) %></span>
<span><%= link "Editer", to: Routes.class_path(@conn, :edit, class) %></span>
<span><%= link "Supprimer", to: Routes.class_path(@conn, :delete, class), method: :delete, data: [confirm: "Vous êtes sur ?"] %></span>
</td>
</tr>
<% end %>
</tbody>
</table>