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,7 @@
<h1>Editer un devoir</h1>
<span><%= link "Retour", to: Routes.assignment_path(@conn, :index) %></span>
<hr>
<%= render "form.html", Map.put(assigns, :action, Routes.assignment_path(@conn, :update, @assignment)) %>

View File

@@ -0,0 +1,26 @@
<%= 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, "Classe" %>
<%= select f, :class_id, @classes %>
<%= label f, "Titre" %>
<%= text_input f, :title %>
<%= error_tag f, :title %>
<%= label f, "Dénomination" %>
<%= text_input f, :slug %>
<%= error_tag f, :slug %>
<%= label f, "Echéance" %>
<%= date_select f, :due %>
<%= error_tag f, :due %>
<div>
<%= submit "Sauvegarder" %>
</div>
<% end %>

View File

@@ -0,0 +1,38 @@
<h1>Liste des devoirs</h1>
<span><%= link "Ajouter un devoir", to: Routes.assignment_path(@conn, :new) %></span>
<hr>
<table>
<thead>
<tr>
<th>Titre</th>
<th>Dénominateur</th>
<th>Echéance</th>
<th>Classe</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<%= for assignment <- @assignments do %>
<tr>
<td><%= assignment.title %></td>
<td><%= assignment.slug %></td>
<td><%= assignment.due %></td>
<%= if assignment.class do %>
<td><%= link assignment.class.name, to: Routes.class_path(@conn, :show, assignment.class.id) %></td>
<% else %>
<td></td>
<% end %>
<td>
<span><%= link "Voir", to: Routes.assignment_path(@conn, :show, assignment) %></span>
<span><%= link "Editer", to: Routes.assignment_path(@conn, :edit, assignment) %></span>
<span><%= link "Supprimer", to: Routes.assignment_path(@conn, :delete, assignment), method: :delete, data: [confirm: "Vous êtes sur ?"] %></span>
</td>
</tr>
<% end %>
</tbody>
</table>

View File

@@ -0,0 +1,7 @@
<h1>Nouveau devoir</h1>
<span><%= link "Retour", to: Routes.assignment_path(@conn, :index) %></span>
<hr>
<%= render "form.html", Map.put(assigns, :action, Routes.assignment_path(@conn, :create)) %>

View File

@@ -0,0 +1,67 @@
<h1>Devoir : <%= @assignment.title %> | Classe : <%= @assignment.class.name %></h1>
<span><%= link "Editer", to: Routes.assignment_path(@conn, :edit, @assignment) %></span>
<span><%= link "Retour", to: Routes.assignment_path(@conn, :index) %></span>
<hr>
<h2>Informations générales</h2>
<ul>
<li>
<strong>Classe:</strong>
<%= @assignment.class.name %>
</li>
<li>
<strong>Echéance:</strong>
<%= @assignment.due %>
</li>
<li>
<strong>Dénominateur:</strong>
<%= @assignment.slug %>
</li>
</ul>
<hr>
<h2>Liste des rendus pour ce devoir</h2>
<%= if length(@assignment.students_works) > 0 do %>
<%= link "Générer une archive de tous les rendus", to: Routes.assignment_path(@conn, :archive, @assignment.id), target: "_blank" %>
<table>
<thead>
<tr>
<th>Elève</th>
<th>Date</th>
<th>Action</th>
<tr>
</thead>
<tbody>
<%= for work <- @assignment.students_works do %>
<tr>
<td><%= link "#{work.student.lastname} #{work.student.firstname}", to: Routes.student_path(@conn, :show, work.student.id) %></td>
<td><%= work.inserted_at %></td>
<td><%= link "Télécharger", to: Path.join([Application.fetch_env!(:confient, :domain), "uploads", @assignment.class.name, @assignment.slug, work.path]), target: "_blank" %></td>
</tr>
<% end %>
</tbody>
</table>
<% else %>
<p>Aucun rendu</p>
<% end %>
<%= if length(@assignment.students_works) > 0 do %>
<h2>Liste des élèves n'ayant pas rendu ce devoir</h2>
<ul>
<%= for stud <- @missing do %>
<li><%= link "#{stud.lastname} #{stud.firstname}", to: Routes.student_path(@conn, :show, stud.id) %></li>
<% end %>
</ul>
<% end %>