Initial commit
This commit is contained in:
23
lib/confient_web/templates/deposit/form.html.eex
Normal file
23
lib/confient_web/templates/deposit/form.html.eex
Normal file
@@ -0,0 +1,23 @@
|
||||
<h1>Rendu des devoirs - <%= @class.name %></h1>
|
||||
|
||||
<%= if @changeset.action do %>
|
||||
<div class="alert alert-danger">
|
||||
<p>Oops, quelque chose c'est mal passé, merci de vérifier le formulaire</p>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= form_for @changeset, Routes.deposit_path(@conn, :deposit, @class.id), [multipart: true], fn f -> %>
|
||||
<%= label f, "Elève" %>
|
||||
<%= select f, :student_id, Enum.map(@class.students, &{"#{&1.lastname} #{&1.firstname}", &1.id}), selected: @student_id %>
|
||||
|
||||
<%= label f, "Devoir" %>
|
||||
<%= select f, :assignment_id, Enum.map(@assignments, &{"#{&1.title} - #{&1.due}", &1.id}), selected: @assignment_id %>
|
||||
|
||||
<%= label f, "Fichier (formats acceptés : pdf, rtf, odt, doc, docx)" %>
|
||||
<%= file_input f, :file %>
|
||||
|
||||
<div>
|
||||
<%= submit "Envoyer" %>
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
24
lib/confient_web/templates/deposit/index.html.eex
Normal file
24
lib/confient_web/templates/deposit/index.html.eex
Normal file
@@ -0,0 +1,24 @@
|
||||
<h1>Liste des rendus</h1>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Elève</th>
|
||||
<th>Classe</th>
|
||||
<th>Devoir</th>
|
||||
<th>Validé</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<%= for work <- @works do %>
|
||||
<tr>
|
||||
<td><%= link "#{work.student.lastname} #{work.student.firstname}", to: Routes.student_path(@conn, :show, work.student.id) %></td>
|
||||
<td><%= link work.student.class.name, to: Routes.class_path(@conn, :show, work.student.class.id) %></td>
|
||||
<td><%= link "#{work.assignment.title} | #{work.assignment.slug}", to: Routes.assignment_path(@conn, :show, work.assignment.id) %></td>
|
||||
<td><%= work.inserted_at %></td>
|
||||
<td><%= link "Télécharger", to: Path.join([Application.fetch_env!(:confient, :domain), "uploads", work.student.class.name, work.assignment.slug, work.path]), target: "_blank" %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
Reference in New Issue
Block a user