Skip to content

Commit

Permalink
Add invited shinpans to home page (#575)
Browse files Browse the repository at this point in the history
Fixes #573

Co-authored-by: Yannis JAQUET <[email protected]>
  • Loading branch information
yannis and yannis authored Aug 3, 2024
1 parent cacb1eb commit 41d39de
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/controllers/cups_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def show
@current_cup = @cup
@grouped_events = @cup.events.order(:start_on).group_by { |e| e.start_on.to_date }
@headlines = @cup.headlines.shown.order("headlines.created_at DESC")
@shinpans = @cup.kenshis.shinpans.order(:last_name, :first_name)
template = if @cup.canceled?
"show_canceled"
elsif Date.current > @cup.start_on.to_date
Expand Down
28 changes: 28 additions & 0 deletions app/views/cups/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,34 @@
<p>
<%= t(".shinpans.info") %>
</p>
<% if @shinpans.any? %>
<h3 class="mt-10">
<%= t(".shinpans.invited.title") %>
</h3>
<table class="table">
<tbody>
<% @shinpans.each.with_index do |shinpan, index| %>
<tr>
<td class="text-right">
<%= index + 1 %>.
</td>
<td class="text-right">
<%= shinpan.female ? User.human_attribute_name(:ms) : User.human_attribute_name(:mr) %>
</td>
<th class="lg:whitespace-nowrap text-left">
<%= shinpan.full_name %>
</th>
<td class="text-left">
<em><%= shinpan.grade %></em>
</td>
<td class="text-right">
<%= shinpan.club.name %>
</td>
</tr>
<% end %>
</tbody>
</table>
<% end %>
</div>
<% if @cup.products.any? %>
<div id="fees" class="prose prose-red-900 prose-lg text-gray-900 lg:col-span-2">
Expand Down
2 changes: 2 additions & 0 deletions config/locales/views/cups.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ en:
title: Shinpan (referees)
info: |
This year, we will have a few invited official referees, but we still rely on the most senior among you to supplement the referee team when you are not competing.
invited:
title: Invited referees
social:
title: Follow us on
venue:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/views/cups.fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ fr:
title: Shinpan (arbitres)
info: |
Cette année, nous aurons quelques arbitres officiels invités, mais nous comptons toujours sur les plus gradés d'entre vous pour compléter l'effectif des arbitres lorsque vous ne combattez pas.
invited:
title: Arbitres invités
social:
title: Retrouvez-nous sur
venue:
Expand Down

0 comments on commit 41d39de

Please sign in to comment.