diff --git a/app/helpers/lotteries/entrant_service_details_helper.rb b/app/helpers/lotteries/entrant_service_details_helper.rb index 70998cab5..56159b7fc 100644 --- a/app/helpers/lotteries/entrant_service_details_helper.rb +++ b/app/helpers/lotteries/entrant_service_details_helper.rb @@ -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" @@ -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 diff --git a/app/models/lottery_entrant.rb b/app/models/lottery_entrant.rb index 4c0666407..6cee157fe 100644 --- a/app/models/lottery_entrant.rb +++ b/app/models/lottery_entrant.rb @@ -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 diff --git a/app/views/lotteries/_manage_entrants_table.html.erb b/app/views/lotteries/_manage_entrants_table.html.erb index e0bf46345..1cc438f4e 100644 --- a/app/views/lotteries/_manage_entrants_table.html.erb +++ b/app/views/lotteries/_manage_entrants_table.html.erb @@ -8,8 +8,7 @@ Gender From Withdrawn? - Service Form Received - Completed? + Service Status @@ -20,8 +19,7 @@ <%= entrant.gender.titleize %> <%= entrant.flexible_geolocation %> <%= render partial: "lottery_entrants/withdrawn_form", locals: { organization: @presenter.organization, lottery: @presenter.lottery, entrant: entrant } %> - <%= render partial: "lottery_entrants/service_completed_form", locals: { organization: @presenter.organization, lottery: @presenter.lottery, entrant: entrant } %> - <%= render partial: "lottery_entrants/service_completed_indicator", locals: { entrant: entrant } %> + <%= render partial: "lottery_entrants/service_status_indicator", locals: { entrant: entrant } %> <% end %> diff --git a/app/views/lotteries/entrant_service_details/_service_form_status_card.html.erb b/app/views/lotteries/entrant_service_details/_service_form_status_card.html.erb index 7dae276a2..c7f6aedba 100644 --- a/app/views/lotteries/entrant_service_details/_service_form_status_card.html.erb +++ b/app/views/lotteries/entrant_service_details/_service_form_status_card.html.erb @@ -7,7 +7,9 @@
Status
+ <%= service_form_status_with_icon(presenter.__getobj__) %> +
diff --git a/app/views/lottery_entrants/_service_completed_form.html.erb b/app/views/lottery_entrants/_service_completed_form.html.erb deleted file mode 100644 index ec61221c2..000000000 --- a/app/views/lottery_entrants/_service_completed_form.html.erb +++ /dev/null @@ -1,8 +0,0 @@ -<%= form_with(model: [organization, lottery, entrant], html: { method: :patch, data: { controller: "form-auto-submit" } }) do |f| %> -
- <%= f.text_field :service_completed_date, - placeholder: "mm/dd/yyyy", - id: dom_id(entrant, :service_completed_date_input), - value: (l(entrant.service_completed_date, format: :default_full_year) if entrant.service_completed?) %> -
-<% end %> diff --git a/app/views/lottery_entrants/_service_completed_indicator.html.erb b/app/views/lottery_entrants/_service_completed_indicator.html.erb deleted file mode 100644 index 3eaf85002..000000000 --- a/app/views/lottery_entrants/_service_completed_indicator.html.erb +++ /dev/null @@ -1,5 +0,0 @@ -<%= content_tag(:div, id: dom_id(entrant, :service_completed_indicator)) do %> - <%= entrant.service_completed? ? - fa_icon("circle-check", type: :solid, class: "text-success") : - fa_icon("circle-xmark", type: :regular, class: "text-danger") %> -<% end %> diff --git a/app/views/lottery_entrants/_service_status_indicator.html.erb b/app/views/lottery_entrants/_service_status_indicator.html.erb new file mode 100644 index 000000000..be0fbacb8 --- /dev/null +++ b/app/views/lottery_entrants/_service_status_indicator.html.erb @@ -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 %>