Browse Source

adding editing buttons

pull/717/head
JG 3 years ago
parent
commit
f1c4d6842a
  1. 6
      app/models/scheme.rb
  2. 1
      app/views/schemes/show.html.erb

6
app/models/scheme.rb

@ -130,9 +130,9 @@ class Scheme < ApplicationRecord
def display_attributes def display_attributes
[ [
{ name: "Service code", value: id_to_display }, { name: "Service code", value: id_to_display },
{ name: "Name", value: service_name }, { name: "Name", value: service_name, edit: true},
{ name: "Confidential information", value: sensitive }, { name: "Confidential information", value: sensitive, edit: true },
{ name: "Housing stock owned by", value: owning_organisation.name }, { name: "Housing stock owned by", value: owning_organisation.name, edit: true },
{ name: "Managed by", value: managing_organisation&.name }, { name: "Managed by", value: managing_organisation&.name },
{ name: "Type of scheme", value: scheme_type }, { name: "Type of scheme", value: scheme_type },
{ name: "Registered under Care Standards Act 2000", value: registered_under_care_act }, { name: "Registered under Care Standards Act 2000", value: registered_under_care_act },

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

@ -19,6 +19,7 @@
<%= summary_list.row do |row| %> <%= summary_list.row do |row| %>
<% row.key { attr[:name].eql?("Registered under Care Standards Act 2000") ? "Registered under Care Standards Act 2000" : attr[:name].to_s.humanize } %> <% row.key { attr[:name].eql?("Registered under Care Standards Act 2000") ? "Registered under Care Standards Act 2000" : attr[:name].to_s.humanize } %>
<% row.value { details_html(attr) } %> <% row.value { details_html(attr) } %>
<% row.action(text: "Change", href: scheme_primary_client_group_path(scheme_id: @scheme.id, check_answers: true)) if attr[:edit] %>
<% end %> <% end %>
<% end %> <% end %>
<% end %> <% end %>

Loading…
Cancel
Save