Browse Source

Just use visible locations (#2506)

pull/2513/head
Manny Dinssa 6 months ago committed by GitHub
parent
commit
9e35b26dcf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      app/helpers/question_view_helper.rb
  2. 2
      app/views/schemes/_scheme_list.html.erb

4
app/helpers/question_view_helper.rb

@ -26,8 +26,8 @@ module QuestionViewHelper
def answer_option_append(resource)
return unless resource.instance_of?(Scheme)
confirmed_locations_count = resource.locations.confirmed.size
unconfirmed_locations_count = resource.locations.unconfirmed.size
confirmed_locations_count = resource.locations.visible.confirmed.size
unconfirmed_locations_count = resource.locations.visible.unconfirmed.size
"#{confirmed_locations_count} completed #{'location'.pluralize(confirmed_locations_count)}, #{unconfirmed_locations_count} incomplete #{'location'.pluralize(unconfirmed_locations_count)}"
end

2
app/views/schemes/_scheme_list.html.erb

@ -25,7 +25,7 @@
<% row.with_cell(text: simple_format(scheme_cell(scheme), { class: "govuk-!-font-weight-bold scheme-name-cell" }, wrapper_tag: "div")) %>
<% row.with_cell(text: scheme.owning_organisation&.name) %>
<% row.with_cell(text: scheme.id_to_display) %>
<% row.with_cell(text: scheme.locations&.count) %>
<% row.with_cell(text: scheme.locations.visible&.count) %>
<% row.with_cell(text: status_tag_from_resource(scheme)) %>
<% end %>
<% end %>

Loading…
Cancel
Save