2024-01-19 18:25:59 -06:00
|
|
|
<div class="container mt-5">
|
|
|
|
<div class="row justify-content-center">
|
|
|
|
<div class="col-md-6">
|
|
|
|
<h1 class="mb-4 text-center">Participant Details</h1>
|
2024-01-16 23:10:18 -06:00
|
|
|
|
2024-01-19 18:25:59 -06:00
|
|
|
<div class="card">
|
|
|
|
<div class="card-body">
|
2024-01-20 00:52:54 -06:00
|
|
|
|
2024-01-19 18:25:59 -06:00
|
|
|
<p class="card-text">
|
2024-01-20 00:28:17 -06:00
|
|
|
<strong>Name:</strong>
|
|
|
|
<%= @participant.first_name %> <%= @participant.last_name %>
|
2024-01-19 18:25:59 -06:00
|
|
|
</p>
|
2024-01-20 00:28:17 -06:00
|
|
|
|
2024-01-19 18:25:59 -06:00
|
|
|
<p class="card-text">
|
|
|
|
<strong>Address:</strong>
|
|
|
|
<%= @participant.address %>
|
|
|
|
</p>
|
2024-01-16 23:10:18 -06:00
|
|
|
|
2024-01-19 23:38:15 -06:00
|
|
|
<p class="card-text">
|
|
|
|
<strong>Phone:</strong>
|
|
|
|
<%= @participant.phone %>
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p class="card-text">
|
|
|
|
<strong>Email:</strong>
|
|
|
|
<%= @participant.email %>
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p class="card-text">
|
|
|
|
<strong>MCI:</strong>
|
|
|
|
<%= @participant.mci %>
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p class="card-text">
|
|
|
|
<strong>DOB:</strong>
|
2024-01-23 00:03:02 -06:00
|
|
|
<%= @participant.dob.strftime('%B %d, %Y') if @participant.dob.present? %>
|
2024-01-19 23:38:15 -06:00
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
|
|
<p class="card-text">
|
|
|
|
<strong>SSN:</strong>
|
|
|
|
<%= @participant.ssn %>
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p class="card-text">
|
|
|
|
<strong>Gender:</strong>
|
|
|
|
<%= @participant.gender %>
|
|
|
|
</p>
|
|
|
|
|
2024-01-19 18:25:59 -06:00
|
|
|
<!-- Repeat this pattern for other attributes like phone, email, etc. -->
|
2024-01-16 23:10:18 -06:00
|
|
|
|
2024-01-19 18:25:59 -06:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="mt-3 d-flex justify-content-between">
|
2024-01-22 21:46:20 -06:00
|
|
|
<%= link_to 'Edit', edit_participant_path(@participant), class: "btn btn-dark" %>
|
2024-01-19 18:25:59 -06:00
|
|
|
<%= link_to 'Back to List', participants_path, class: "btn btn-secondary" %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2024-01-22 22:57:37 -06:00
|
|
|
|
|
|
|
|
2024-01-22 23:46:09 -06:00
|
|
|
<h2 class="mt-4">Linked Workers</h2>
|
|
|
|
<table class="table table-striped">
|
|
|
|
<thead class="table-dark">
|
2024-01-22 22:57:37 -06:00
|
|
|
<tr>
|
|
|
|
<th>Worker Name</th>
|
|
|
|
<th>Start Date</th>
|
|
|
|
<th>End Date</th>
|
2024-01-23 00:14:10 -06:00
|
|
|
<th>Actions</th>
|
2024-01-22 22:57:37 -06:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
2024-01-23 00:14:10 -06:00
|
|
|
<% @participant.employments.each do |employment| %>
|
|
|
|
<tr>
|
|
|
|
<td><%= employment.worker&.name || 'No Worker Assigned' %></td>
|
|
|
|
<td><%= employment.start_date.strftime('%B %d, %Y') if employment.start_date.present? %></td>
|
|
|
|
<td><%= employment.end_date.strftime('%B %d, %Y') if employment.end_date.present? %></td>
|
|
|
|
<td>
|
2024-01-23 00:31:35 -06:00
|
|
|
<%= link_to edit_employment_path(employment), class: 'btn btn-sm btn-warning' do %>
|
|
|
|
<i class="bi bi-pencil-fill"></i> <!-- Pencil icon -->
|
|
|
|
<% end %>
|
|
|
|
<%= link_to employment, method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-sm btn-danger' do %>
|
|
|
|
<i class="bi bi-trash" style="color: black;"></i> <!-- Trash can icon with black color -->
|
|
|
|
<% end %>
|
2024-01-23 00:14:10 -06:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<% end %>
|
2024-01-22 22:57:37 -06:00
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
2024-01-23 00:14:10 -06:00
|
|
|
|
2024-01-22 23:48:37 -06:00
|
|
|
<%= form_with(model: [@participant, @employment], url: link_worker_participant_path(@participant), method: :post, class: 'row g-3') do |form| %>
|
|
|
|
<div class="col-md-6">
|
|
|
|
<%= form.label :worker_id, "Select Worker", class: 'form-label' %>
|
|
|
|
<%= form.collection_select :worker_id, Worker.all, :id, :name, { include_blank: true }, { class: 'form-select' } %>
|
2024-01-22 22:57:37 -06:00
|
|
|
</div>
|
|
|
|
|
2024-01-22 23:48:37 -06:00
|
|
|
<div class="col-md-3">
|
|
|
|
<%= form.label :start_date, class: 'form-label' %>
|
|
|
|
<%= form.date_field :start_date, class: 'form-control' %>
|
2024-01-22 22:57:37 -06:00
|
|
|
</div>
|
|
|
|
|
2024-01-22 23:48:37 -06:00
|
|
|
<div class="col-md-3">
|
|
|
|
<%= form.label :end_date, class: 'form-label' %>
|
|
|
|
<%= form.date_field :end_date, class: 'form-control' %>
|
2024-01-22 22:57:37 -06:00
|
|
|
</div>
|
|
|
|
|
2024-01-22 23:48:37 -06:00
|
|
|
<div class="col-12">
|
|
|
|
<%= form.submit "Link Worker", class: 'btn btn-dark' %>
|
|
|
|
</div>
|
2024-01-22 22:57:37 -06:00
|
|
|
<% end %>
|
2024-01-22 23:46:09 -06:00
|
|
|
|