Skip to content

Commit

Permalink
Remove final references to service_completed_date
Browse files Browse the repository at this point in the history
  • Loading branch information
moveson committed Dec 19, 2024
1 parent 5c543c9 commit dcef5eb
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 20 deletions.
4 changes: 2 additions & 2 deletions app/helpers/lotteries/entrant_service_details_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def button_to_remove_completed_service_form(presenter)

def service_form_status_with_icon(entrant_service_detail)
case
when entrant_service_detail.completed_form.blank?
when entrant_service_detail.nil? || entrant_service_detail.completed_form.blank?
title = "Not received"
icon = "file-slash"
color = "warning"
Expand All @@ -31,6 +31,6 @@ def service_form_status_with_icon(entrant_service_detail)
color = "secondary"
end

content_tag :span, fa_icon(icon, type: :regular, text: title, class: "fs-4 text-#{color}"), class: "fw-bold fs-5"
content_tag :span, fa_icon(icon, type: :regular, text: title, class: "text-#{color}")
end
end
2 changes: 1 addition & 1 deletion app/models/lottery_entrant.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class LotteryEntrant < ApplicationRecord
include Delegable
include CapitalizeAttributes

# self.ignored_columns = %w[service_completed_date]
self.ignored_columns = %w[service_completed_date]

belongs_to :person, optional: true
belongs_to :division, class_name: "LotteryDivision", foreign_key: "lottery_division_id", touch: true
Expand Down
6 changes: 2 additions & 4 deletions app/views/lotteries/_manage_entrants_table.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
<th>Gender</th>
<th>From</th>
<th class="text-center">Withdrawn?</th>
<th class="text-center">Service Form Received</th>
<th class="text-center">Completed?</th>
<th class="text-center">Service Status</th>
</tr>
</thead>
<tbody>
Expand All @@ -20,8 +19,7 @@
<td><%= entrant.gender.titleize %></td>
<td><%= entrant.flexible_geolocation %></td>
<td class="text-center"><%= render partial: "lottery_entrants/withdrawn_form", locals: { organization: @presenter.organization, lottery: @presenter.lottery, entrant: entrant } %></td>
<td class="text-center"><%= render partial: "lottery_entrants/service_completed_form", locals: { organization: @presenter.organization, lottery: @presenter.lottery, entrant: entrant } %></td>
<td class="text-center"><%= render partial: "lottery_entrants/service_completed_indicator", locals: { entrant: entrant } %></td>
<td class="text-center"><%= render partial: "lottery_entrants/service_status_indicator", locals: { entrant: entrant } %></td>
</tr>
<% end %>
</tbody>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
<div class="fs-3 fw-bold">Status</div>
</div>
<div class="col text-end pt-1">
<span class="fw-bold fs-5">
<%= service_form_status_with_icon(presenter.__getobj__) %>
</span>
</div>
</div>
</div>
Expand Down
8 changes: 0 additions & 8 deletions app/views/lottery_entrants/_service_completed_form.html.erb

This file was deleted.

This file was deleted.

5 changes: 5 additions & 0 deletions app/views/lottery_entrants/_service_status_indicator.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<%# locals: (entrant:) %>

<%= content_tag(:div, id: dom_id(entrant, :service_status_indicator)) do %>
<%= service_form_status_with_icon(entrant.service_detail) %>
<% end %>

0 comments on commit dcef5eb

Please sign in to comment.