Initial commit
This commit is contained in:
7
lib/confient_web/templates/class/edit.html.eex
Normal file
7
lib/confient_web/templates/class/edit.html.eex
Normal 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)) %>
|
||||
15
lib/confient_web/templates/class/form.html.eex
Normal file
15
lib/confient_web/templates/class/form.html.eex
Normal 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 %>
|
||||
29
lib/confient_web/templates/class/index.html.eex
Normal file
29
lib/confient_web/templates/class/index.html.eex
Normal 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>
|
||||
7
lib/confient_web/templates/class/new.html.eex
Normal file
7
lib/confient_web/templates/class/new.html.eex
Normal 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)) %>
|
||||
14
lib/confient_web/templates/class/show.html.eex
Normal file
14
lib/confient_web/templates/class/show.html.eex
Normal 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>
|
||||
Reference in New Issue
Block a user