<% provide(:title, "Teilnehmerliste") %>

<p>
  <%= link_to "Wettbewerbsdetails anzeigen", jmd_competition_path(@competition), class: "btn" %>
</p>

<hr>

<table class="table table-hover">
  <thead>
    <tr>
      <th>Nachname</th>
      <th>Vorname</th>
      <th>Geburtsdatum</th>
      <th>Land</th>
      <th>Auftritte</th>
      <th>&nbsp;</th>
    </tr>
  </thead>
  <tbody>
    <% @participants.each do |participant| %>
      <tr>
        <td><%= participant.last_name %></td>
        <td><%= participant.first_name %></td>
        <td><%= l participant.birthdate %></td>
        <td><%= flag_tag participant.country.country_code %></td>
        <td>
          <%= participant.appearances.joins(:performance).where(performances: { competition_id: @competition }).size %>
        </td>
        <td>
          <%= link_to_modal icon_tag("eye-open", title: "Teilnehmerdetails anzeigen"), :participant, participant.id %>
        </td>
      </tr>

      <!-- Modal view for participant details (render here so no second loop is needed) -->
      <%= render partial: "participant_modal", locals: { participant: participant } %>
    <% end %>
  </tbody>
</table>

<% provide(:title, "Teilnehmer für #{@competition.name}") %>

<p>
  <%= link_to "Wettbewerbsdetails anzeigen", jmd_competition_path(@competition), class: "btn" %>
</p>

<hr>

<table class="table table-hover">
  <thead>
    <tr>
      <th>Nachname</th>
      <th>Vorname</th>
      <th>Geburtsdatum</th>
      <th>Land</th>
      <th>Kategorien</th>
      <th>&nbsp;</th>
    </tr>
  </thead>
  <tbody>
    <% @participants.each do |participant| %>
      <tr>
        <td><%= participant.last_name %></td>
        <td><%= participant.first_name %></td>
        <td><%= l participant.birthdate %></td>
        <td><%= flag_tag participant.country.country_code %></td>
        <td>
          <% participant.performances.in_competition(@competition).includes(:category).each do |performance| %>
            <%= link_to performance.category.name, jmd_performance_path(performance) %><br>
          <% end %>
        </td>
    </p>
        </td>
        <td>
          <%= link_to_modal icon_tag("eye-open", title: "Teilnehmerdetails anzeigen"), :participant, participant.id %>
        </td>
      </tr>

      <!-- Modal view for participant details (render here so no second loop is needed) -->
      <%= render partial: "participant_modal", locals: { participant: participant } %>
    <% end %>
  </tbody>
</table>

Add links to performances of each participant in list
Add links to performances of each participant in list
