diff --git a/app/models/location.rb b/app/models/location.rb index e58f6dec6..a4dedd6ae 100644 --- a/app/models/location.rb +++ b/app/models/location.rb @@ -1,3 +1,22 @@ class Location < ApplicationRecord belongs_to :scheme + + WHEELCHAIR_ADAPTATION = { + 0 => "No", + 1 => "Yes", + }.freeze + + def display_attributes + [ + { name: "Location code ", value: location_code, suffix: false }, + { name: "Postcode", value: postcode, suffix: county }, + { name: "Type of unit", value: type_of_unit, suffix: false }, + { name: "Type of building", value: type_of_building, suffix: false }, + { name: "Wheelchair adaptation", value: wheelchair_adaptation_display, suffix: false }, + ] + end + + def wheelchair_adaptation_display + WHEELCHAIR_ADAPTATION[wheelchair_adaptation] + end end diff --git a/app/views/schemes/locations.html.erb b/app/views/schemes/locations.html.erb index 938286066..b08beb2f9 100644 --- a/app/views/schemes/locations.html.erb +++ b/app/views/schemes/locations.html.erb @@ -5,15 +5,14 @@ <%= render partial: "organisations/headings", locals: { main: @scheme.service_name, sub: nil } %> - <%= render SubNavigationComponent.new( items: scheme_items(request.path, @scheme.id, @scheme.locations.count), ) %>