Initial commit
This commit is contained in:
17
lib/confient_web/templates/student/bulkform.html.eex
Normal file
17
lib/confient_web/templates/student/bulkform.html.eex
Normal file
@@ -0,0 +1,17 @@
|
||||
<h1>Ajouter un lot d'élèves</h1>
|
||||
|
||||
<form action="<%= Routes.student_path(@conn, :bulkcreate) %>" method="post" enctype="multipart/form-data">
|
||||
<input type="hidden" value="<%= @token %>" name="_csrf_token"/>
|
||||
|
||||
<%= label :class, "Classe" %>
|
||||
<%= select :class, :class_id, @classes %>
|
||||
|
||||
<%= label :class, "Fichier" %>
|
||||
<%= file_input :file, :list %>
|
||||
|
||||
<div>
|
||||
<%= submit "Ajouter" %>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<span><%= link "Retour", to: Routes.student_path(@conn, :index) %></span>
|
||||
7
lib/confient_web/templates/student/edit.html.eex
Normal file
7
lib/confient_web/templates/student/edit.html.eex
Normal file
@@ -0,0 +1,7 @@
|
||||
<h1>Editer un élève</h1>
|
||||
|
||||
<span><%= link "Retour", to: Routes.student_path(@conn, :index) %></span>
|
||||
|
||||
<hr>
|
||||
|
||||
<%= render "form.html", Map.put(assigns, :action, Routes.student_path(@conn, :update, @student)) %>
|
||||
22
lib/confient_web/templates/student/form.html.eex
Normal file
22
lib/confient_web/templates/student/form.html.eex
Normal file
@@ -0,0 +1,22 @@
|
||||
<%= form_for @changeset, @action, fn f -> %>
|
||||
<%= 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 %>
|
||||
|
||||
<%= label f, "Nom" %>
|
||||
<%= text_input f, :lastname %>
|
||||
<%= error_tag f, :lastname %>
|
||||
|
||||
<%= label f, "Prénom" %>
|
||||
<%= text_input f, :firstname %>
|
||||
<%= error_tag f, :firstname %>
|
||||
|
||||
<%= label f, "Classe" %>
|
||||
<%= select f, :class_id, @classes %>
|
||||
|
||||
<div>
|
||||
<%= submit "Sauvegarder" %>
|
||||
</div>
|
||||
<% end %>
|
||||
32
lib/confient_web/templates/student/index.html.eex
Normal file
32
lib/confient_web/templates/student/index.html.eex
Normal file
@@ -0,0 +1,32 @@
|
||||
<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>
|
||||
5
lib/confient_web/templates/student/new.html.eex
Normal file
5
lib/confient_web/templates/student/new.html.eex
Normal file
@@ -0,0 +1,5 @@
|
||||
<h1>Ajouter un nouvel élève</h1>
|
||||
|
||||
<%= render "form.html", Map.put(assigns, :action, Routes.student_path(@conn, :create)) %>
|
||||
|
||||
<span><%= link "Retour", to: Routes.student_path(@conn, :index) %></span>
|
||||
52
lib/confient_web/templates/student/show.html.eex
Normal file
52
lib/confient_web/templates/student/show.html.eex
Normal file
@@ -0,0 +1,52 @@
|
||||
<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 %>
|
||||
Reference in New Issue
Block a user