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

53 lines
1.1 KiB
Elixir

<h1><%= @student.lastname %> - <%= @student.firstname %></h1>
<span><%= link "Editer", to: Routes.student_path(@conn, :edit, @student) %></span>
<span><%= link "Retour", to: Routes.student_path(@conn, :index) %></span>
<hr>
<h2>Informations générales</h2>
<ul>
<li>
<strong>Nom:</strong>
<%= @student.lastname %>
</li>
<li>
<strong>Prénom:</strong>
<%= @student.firstname %>
</li>
<li>
<strong>Classe:</strong>
<%= @student.class.name %>
</li>
</ul>
<h2>Rendus</h2>
<%= if length(@student.students_works) > 0 do %>
<table>
<thead>
<tr>
<th>Titre</th>
<th>Date</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<%= for work <- @student.students_works do %>
<tr>
<td><%= work.assignment.title %></td>
<td><%= work.inserted_at %></td>
<td><%= link "Télécharger", to: Path.join([ConfientWeb.Endpoint.url(), "uploads", @student.class.name, work.assignment.slug, work.path]), target: "_blank" %></td>
</tr>
<% end %>
</tbody>
</table>
<% else %>
<p>Aucun devoir rendu</p>
<% end %>