Updated Styling on Worker Linked Participants to match app. Also Completed linking Participants on the Vendor show view.

This commit is contained in:
Ben 2024-02-02 17:13:06 -06:00
parent 1265d885ec
commit 611dee5eb8
2 changed files with 49 additions and 3 deletions

View File

@ -43,3 +43,44 @@
</div>
</div>
</div>
<div class="row mt-4">
<div class="col-md-6">
<h2 class="mt-4">Linked Participants</h2>
<% if @vendor.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>
<% @vendor.service_contracts.each do |contract| %>
<tr>
<% participant = contract.participant %>
<td><%= participant ? "#{participant.first_name} #{participant.last_name}" : 'No Participant Assigned' %></td>
<td><%= contract.start_date.strftime('%B %d, %Y') if contract.start_date.present? %></td>
<td><%= contract.end_date.strftime('%B %d, %Y') if contract.end_date.present? %></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 %>
</tbody>
</table>
<% else %>
<p>No linked participants.</p>
<% end %>
</div>
</div>

View File

@ -66,8 +66,12 @@
<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>
<%= link_to 'View', participant_path(participant), class: 'btn btn-sm btn-secondary' %>
<%= link_to 'Edit', edit_employment_path(employment), class: 'btn btn-sm btn-info' %>
<%= 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_employment_path(employment), 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 %>
@ -97,11 +101,12 @@
<%= form.date_field :end_date, class: 'form-control' %>
</div>
<div class="col-12">
<div class="col-12 text-center"> <!-- Added text-center for button alignment -->
<%= form.submit "Link Participant", class: 'btn btn-dark' %>
</div>
<% end %>
<%# JavaScript for Participant Autocomplete %>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://code.jquery.com/ui/1.13.0/jquery-ui.min.js"></script>