obdev/app/views/participants/index.html.erb

49 lines
1.5 KiB
Plaintext
Raw Normal View History

<div class="container mt-5">
<h1 class="mb-4 text-center">Participants</h1>
<table class="table table-striped table-hover">
<thead class="table-dark">
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>Address</th>
<th>Phone</th>
<th>Email</th>
<th>Program</th>
<th>MCI</th>
<th>DOB</th>
<th colspan="3"></th>
</tr>
</thead>
<tbody>
<% @participants.each do |participant| %>
<tr>
<td><%= participant.first_name %></td>
<td><%= participant.last_name %></td>
<td><%= participant.address %></td>
<td><%= participant.phone %></td>
<td><%= participant.email %></td>
<td><%= participant.programs.map(&:name).join(", ") %></td>
<td><%= participant.mci %></td>
<td><%= participant.dob.strftime('%B %d, %Y') if participant.dob %></td>
<td>
<%= link_to participant, class: 'btn btn-sm btn-info' do %>
<i class="bi bi-eye"></i><!-- Eyeball icon for 'Show' -->
<% end %>
</td>
<td>
<%= link_to edit_participant_path(participant), class: 'btn btn-sm btn-primary' do %>
<i class="bi bi-pencil-fill"></i> <!-- Pencil icon for 'Edit' -->
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>
<div class="text-center mt-3">
<%= link_to 'New Participant', new_participant_path, class: 'btn btn-success' %>
</div>
</div>