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 une classe</h1>
<span><%= link "Retour", to: Routes.class_path(@conn, :index) %></span>
<hr>
<%= render "form.html", Map.put(assigns, :action, Routes.class_path(@conn, :update, @class)) %>

View File

@@ -0,0 +1,15 @@
<%= form_for @changeset, @action, [multipart: true], 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, "Dénomination" %>
<%= text_input f, :name %>
<%= error_tag f, :name %>
<div>
<%= submit "Sauvegarder" %>
</div>
<% end %>

View File

@@ -0,0 +1,29 @@
<h1>Liste des classes</h1>
<span><%= link "Ajouter une classe", to: Routes.class_path(@conn, :new) %></span>
<hr>
<table>
<thead>
<tr>
<th>Nom</th>
<th>Nombre d'élèves</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<%= for class <- @classes do %>
<tr>
<td><%= class.name %></td>
<td><%= length(class.students) %></td>
<td>
<span><%= link "Voir", to: Routes.class_path(@conn, :show, class) %></span>
<span><%= link "Editer", to: Routes.class_path(@conn, :edit, class) %></span>
<span><%= link "Supprimer", to: Routes.class_path(@conn, :delete, class), method: :delete, data: [confirm: "Vous êtes sur ?"] %></span>
</td>
</tr>
<% end %>
</tbody>
</table>

View File

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

View File

@@ -0,0 +1,14 @@
<h1><%= @class.name %></h1>
<span><%= link "Editer", to: Routes.class_path(@conn, :edit, @class) %></span>
<span><%= link "Retour", to: Routes.class_path(@conn, :index) %></span>
<hr>
<h2>Liste des élèves</h2>
<ul>
<%= for student <- @class.students do %>
<li><%= link "#{student.lastname} - #{student.firstname}", to: Routes.student_path(@conn, :show, student) %></li>
<% end %>
</ul>