Initial commit

This commit is contained in:
2020-12-12 18:38:31 +01:00
commit f877b78f33
117 changed files with 23104 additions and 0 deletions

View 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>

View 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)) %>

View 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 %>

View 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>

View 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>

View 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 %>