summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Peter <marius.peter@tutanota.com>2024-12-31 19:24:40 +0100
committerMarius Peter <marius.peter@tutanota.com>2024-12-31 19:24:40 +0100
commitfe5c5b24c462243fcb7c13b3f380378d8935fba2 (patch)
tree0305a6deee63ec0dbf6405e7b89fb0329cabf964
parent5286e295a5ba141a547475e2c555335d4297fdcb (diff)
Updated views.
-rw-r--r--app/views/admin/dashboard/index.html.erb7
-rw-r--r--app/views/home/index.html.erb22
-rw-r--r--app/views/layouts/_cookies.html.erb8
-rw-r--r--app/views/layouts/_topnav.html.erb3
-rw-r--r--app/views/tartiflettes/index.html.erb15
5 files changed, 46 insertions, 9 deletions
diff --git a/app/views/admin/dashboard/index.html.erb b/app/views/admin/dashboard/index.html.erb
index 30cf866..b3dc2e9 100644
--- a/app/views/admin/dashboard/index.html.erb
+++ b/app/views/admin/dashboard/index.html.erb
@@ -1,10 +1,13 @@
<h1>Administrateur</h1>
-<!-- <h2>Tartiflettes</h2> -->
-
<p>
<%= button_to "Déconnexion",
session_path(session),
method: :delete %>
</p>
+
+<h2>Tartiflettes</h2>
+
+<%= render "scores_by_category" %>
+
<p><%= link_to "Télécharger tous les scores en format CSV", admin_scores_export_path %></p>
diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb
index cc25992..3dfba3c 100644
--- a/app/views/home/index.html.erb
+++ b/app/views/home/index.html.erb
@@ -1,25 +1,39 @@
<h1>World Tartiflette Tour 2024</h1>
-<%= image_tag("blason_Savoie.png", :alt => "blason de la Savoie", id: "blason", width: 80) %>
+<%= image_tag("blason_Savoie.png",
+ alt: "blason de la Savoie",
+ id: "blason",
+ width: 80) %>
<%= render "code_of_honor" %>
-<!-- <h2>Noter les Tartiflettes</h2> -->
+<h2>Noter</h2>
<div class="tartiflette-container">
<% @tartiflettes.each do |tartiflette| %>
<div class="tartiflette-box">
<p>Tartiflette <%= tartiflette.scoring_id %></p>
<% if session[:agreed_to_code_of_honor] %>
<% if TartifletteScoringService.scored?(tartiflette, session) %>
- <%= link_to "Modifier", tartiflette_edit_scores_path(tartiflette), class: [ "tartiflette-link", "scored" ] %>
+ <%= link_to "Modifier",
+ tartiflette_edit_scores_path(tartiflette),
+ class: [ "tartiflette-link", "scored" ] %>
<% else %>
- <%= link_to "Noter", new_tartiflette_score_path(tartiflette), class: [ "tartiflette-link", "unscored" ] %>
+ <%= link_to "Noter",
+ new_tartiflette_score_path(tartiflette),
+ class: [ "tartiflette-link", "unscored" ] %>
<% end %>
<% end %>
</div>
<% end %>
</div>
+<h2>Participants</h2>
+<ul>
+ <% @tartiflettes.shuffle.each do |tartiflette| %>
+ <li><%= tartiflette.name %></li>
+ <% end %>
+</ul>
+
<p>
<%= link_to "Admin", admin_dashboard_path %>
</p>
diff --git a/app/views/layouts/_cookies.html.erb b/app/views/layouts/_cookies.html.erb
index 0e6949a..a32549d 100644
--- a/app/views/layouts/_cookies.html.erb
+++ b/app/views/layouts/_cookies.html.erb
@@ -3,6 +3,10 @@
Acceptez les cookies ou contribuer 2 € à la tartiflette de
Nicolas 💸
</p>
- <%= button_to "Accepter les cookies", dismiss_banner_path %>
- <%= button_to "Faire un don", dismiss_banner_path %>
+ <%= image_tag("baboon_cookie_icon.webp",
+ alt: "Baboon pointing at viewer",
+ id: "baboon") %>
+<div class="button-group">
+ <%= button_to "Accepter les cookies", accept_cookies_path %>
+ <%= button_to "Faire un don", gift_nico_path %>
</div>
diff --git a/app/views/layouts/_topnav.html.erb b/app/views/layouts/_topnav.html.erb
index f93ed99..1131b3e 100644
--- a/app/views/layouts/_topnav.html.erb
+++ b/app/views/layouts/_topnav.html.erb
@@ -1,5 +1,8 @@
<nav id="top">
<ul>
<li><%= link_to "Accueil", root_path %></li>
+ <%# if current_user.admin? %>
+ <!-- <li><%= link_to "Admin", admin_dashboard_path %></li> -->
+ <%# end %>
</ul>
</nav>
diff --git a/app/views/tartiflettes/index.html.erb b/app/views/tartiflettes/index.html.erb
index 09b2748..c38c6a0 100644
--- a/app/views/tartiflettes/index.html.erb
+++ b/app/views/tartiflettes/index.html.erb
@@ -1,3 +1,16 @@
<h1>Tartiflettes</h1>
-<p>Toutes les tartiflettes</p>
+<table>
+ <thead>
+ <tr>
+ <th>Nom</th>
+ </tr>
+ </thead>
+ <tbody>
+ <% @tartiflettes.each do |tartiflette| %>
+ <tr>
+ <td><%= tartiflette.name %></td>
+ </tr>
+ <% end %>
+ </tbody>
+</table>
Copyright 2019--2025 Marius PETER