diff options
Diffstat (limited to 'app/views/home')
-rw-r--r-- | app/views/home/_code_of_honor.html.erb | 14 | ||||
-rw-r--r-- | app/views/home/index.html.erb | 42 |
2 files changed, 56 insertions, 0 deletions
diff --git a/app/views/home/_code_of_honor.html.erb b/app/views/home/_code_of_honor.html.erb new file mode 100644 index 0000000..517a73e --- /dev/null +++ b/app/views/home/_code_of_honor.html.erb @@ -0,0 +1,14 @@ +<div id="code-of-honor" class="<%= session[:agreed_to_code_of_honor] ? 'accepted' : 'rejected' %>"> + <h2>Code d'honneur</h2> + <p> + Tout Tartifleur s'engage à voter dans le respect de la + tradition de la WTT. Il ou elle se doit de voter en toute + honnêteté intellectuelle afin de favoriser un résultat mérité + ! + </p> + <% if session[:agreed_to_code_of_honor] %> + <%= button_to "Renéguer", toggle_code_of_honor_path %> + <% else %> + <%= button_to "Accepter", toggle_code_of_honor_path %> + <% end %> +</div> diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb new file mode 100644 index 0000000..ca8f3a3 --- /dev/null +++ b/app/views/home/index.html.erb @@ -0,0 +1,42 @@ +<h1>World Tartiflette Tour 2024</h1> + +<%= image_tag("blason_Savoie.png", :alt => "blason de la Savoie", id: "blason", width: 80) %> + +<%= render "code_of_honor" %> + +<h2>Noter les Tartiflettes</h2> +<ul> + <% @tartiflettes.each do |tartiflette| %> + <li><%= tartiflette.scoring_id %> + <% if session[:agreed_to_code_of_honor] %> + <% if TartifletteScoringService.scored?(tartiflette, session) %> + <%= link_to "modifier", tartiflette_edit_scores_path(tartiflette) %> + <% else %> + <%= link_to "noter", new_tartiflette_score_path(tartiflette) %> + <% end %> + <% end %> + </li> + <% end %> +</ul> +<!-- + <h2>Résultats</h2> + <table> + <thead> + <tr> + <th>Tartiflette</th> + <th>Points</th> + </tr> + </thead> + <tbody> + <% TartifletteScoringService.leaderboard.each do |tartiflette, total_score| %> + <tr> + <td><%= tartiflette.scoring_id %></td> + <td><%= total_score %></td> + </tr> + <% end %> + </tbody> + </table> +--> +<p> + <%= link_to "Admin", admin_dashboard_path %> +</p> |