obdev/app/views/employers/show.html.erb

96 lines
2.9 KiB
Plaintext

<div class="container mt-5">
<div class="row">
<div class="col-12">
<h1 class="mb-4 text-center">Employer Details</h1>
</div>
<!-- Employer Information Table -->
<div class="col-12 mb-4">
<table class="table">
<tbody>
<tr>
<th>Name</th>
<td><%= @employer.first_name %> <%= @employer.last_name %></td>
</tr>
<tr>
<th>Address</th>
<td><%= [@employer.address_line_1, @employer.address_line_2, @employer.city, @employer.state, @employer.zip].reject(&:blank?).join(', ') %></td>
</tr>
<tr>
<th>Phone</th>
<td><%= @employer.phone %></td>
</tr>
<tr>
<th>Email</th>
<td><%= @employer.email %></td>
</tr>
<tr>
<th>TIN</th>
<td><%= @employer.tin %></td>
</tr>
<tr>
<th>Date of Birth</th>
<td><%= @employer.dob %></td>
</tr>
<tr>
<th>SSN</th>
<td><%= @employer.ssn %></td>
</tr>
<tr>
<th>Gender</th>
<td><%= @employer.gender %></td>
</tr>
</tbody>
</table>
</div>
</div>
<!-- Action Buttons -->
<div class="row">
<div class="col-12 d-flex justify-content-between mb-4">
<%= link_to 'Edit', edit_employer_path(@employer), class: "btn btn-dark" %>
<%= link_to 'Back to List', employers_path, class: "btn btn-secondary" %>
</div>
</div>
</div>
<div class="container mt-5">
<!-- Employer Details ... -->
<!-- Linked Participants Section -->
<div class="row mt-4">
<div class="col-md-12">
<h2 class="mt-4">Linked Participants</h2>
<% if @employer.employer_records.any? %>
<table class="table table-striped">
<thead class="table-light">
<tr>
<th>Participant Name</th>
<th>Start Date</th>
<th>End Date</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<% @employer.employer_records.each do |employer_record| %>
<tr>
<% participant = employer_record.participant %>
<td><%= "#{participant.first_name} #{participant.last_name}" %></td>
<td><%= employer_record.start_date.strftime('%B %d, %Y') if employer_record.start_date %></td>
<td><%= employer_record.end_date.strftime('%B %d, %Y') if employer_record.end_date %></td>
<td>
<%= link_to 'View', participant_path(participant), class: 'btn btn-sm btn-secondary' %>
<%= link_to 'Edit', edit_employer_record_path(employer_record), class: 'btn btn-sm btn-info' %>
</td>
</tr>
<% end %>
</tbody>
</table>
<% else %>
<p>No linked participants.</p>
<% end %>
</div>
</div>