Browse Source

Fix merge conflict

pull/2510/head
Manny Dinssa 2 years ago committed by Manny Dinssa
parent
commit
fd5b65a277
  1. 3
      app/models/scheme.rb
  2. 7
      app/views/schemes/_scheme_list.html.erb
  3. 3
      app/views/schemes/show.html.erb

3
app/models/scheme.rb

@ -295,6 +295,9 @@ class Scheme < ApplicationRecord
status == :active
end
def all_locations_inactive?
active? && locations.all? { |location| !location.active? }
end
def reactivating_soon?
status == :reactivating_soon
end

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

@ -26,7 +26,12 @@
<% row.with_cell(text: scheme.owning_organisation&.name) %>
<% row.with_cell(text: scheme.id_to_display) %>
<% row.with_cell(text: scheme.locations.visible&.count) %>
<% row.with_cell(text: status_tag_from_resource(scheme)) %>
<% row.with_cell do %>
<%= status_tag_from_resource(scheme) %>
<% if scheme.all_locations_inactive? %>
<%= content_tag(:div, "No currently active locations", class: "app-!-colour-muted", style: "margin-top: 10px") %>
<% end %>
<% end %>
<% end %>
<% end %>
<% end %>

3
app/views/schemes/show.html.erb

@ -26,6 +26,9 @@
<dt class="govuk-summary-list__key">Status</dt>
<dd class="govuk-summary-list__value">
<%= details_html({ name: "Status", value: status_tag_from_resource(@scheme), id: "status" }) %>
<% if @scheme.confirmed? && @scheme.all_locations_inactive? %>
<span class="app-!-colour-muted">No currently active locations</span>
<% end %>
<% if @scheme.confirmed? && @scheme.locations.confirmed.none? && LocationPolicy.new(current_user, @scheme.locations.new).create? %>
<span class="app-!-colour-muted">Complete this scheme by adding a location using the <%= govuk_link_to("‘locations’ tab", scheme_locations_path(@scheme)) %>.</span>
<% end %>

Loading…
Cancel
Save