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

94 lines
2.8 KiB
Plaintext
Raw Normal View History

<div class="container mt-5">
<div class="row">
<div class="col-12">
<h1 class="mb-4 text-center">Vendor Details</h1>
</div>
<!-- Vendor Information Table -->
<div class="col-12 mb-4">
<table class="table">
<tbody>
<tr>
<th>Name</th>
<td><%= @vendor.name %></td>
</tr>
<tr>
<th>DBA</th>
<td><%= @vendor.dba %></td>
</tr>
<tr>
<th>Address</th>
<td><%= [@vendor.address_line_1, @vendor.address_line_2, @vendor.city, @vendor.state, @vendor.zip].reject(&:blank?).join(', ') %></td>
</tr>
<tr>
<th>Phone</th>
<td><%= @vendor.phone %></td>
</tr>
<tr>
<th>Email</th>
<td><%= @vendor.email %></td>
</tr>
<tr>
<th>TIN</th>
<td><%= @vendor.tin %></td>
</tr>
<tr>
<th>Contact Name</th>
<td><%= @vendor.contact %></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_vendor_path(@vendor), class: "btn btn-dark" %>
<%= link_to 'Back to List', vendors_path, class: "btn btn-secondary" %>
</div>
</div>
</div>
<div class="row mt-4">
<div class="col-12">
<h2 class="mt-4">Linked Participants</h2>
<% if @sorted_participants.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>
<% @sorted_participants.each do |participant| %>
<% participant.service_contracts.each do |contract| %>
<tr>
<td><%= "#{participant.first_name} #{participant.last_name}" %></td>
<td><%= contract.start_date.strftime('%B %d, %Y') if contract.start_date %></td>
<td><%= contract.end_date.strftime('%B %d, %Y') if contract.end_date %></td>
<td>
<%= link_to participant_path(participant), class: 'btn btn-sm btn-secondary' do %>
<i class="bi bi-eye"></i> <!-- Eyeball icon for 'Show' -->
<% end %>
<%= link_to edit_service_contract_path(contract), class: 'btn btn-sm btn-info' do %>
<i class="bi bi-pencil-fill" style="color: white;"></i> <!-- Pencil icon for 'Edit' with white color -->
<% end %>
</td>
</tr>
<% end %>
<% end %>
</tbody>
</table>
<% else %>
<p>No linked participants.</p>
<% end %>
</div>
</div>