|
|
@ -10,17 +10,26 @@ module OrganisationsHelper |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def display_organisation_attributes(organisation) |
|
|
|
def display_organisation_attributes(organisation) |
|
|
|
[ |
|
|
|
attributes = [ |
|
|
|
{ name: "Organisation ID", value: "ORG#{organisation.id}", editable: false }, |
|
|
|
{ name: "Organisation ID", value: "ORG#{organisation.id}", editable: false }, |
|
|
|
{ name: "Address", value: organisation.address_string, editable: true }, |
|
|
|
{ name: "Address", value: organisation.address_string, editable: true }, |
|
|
|
{ name: "Telephone number", value: organisation.phone, editable: true }, |
|
|
|
{ name: "Telephone number", value: organisation.phone, editable: true }, |
|
|
|
{ name: "Registration number", value: organisation.housing_registration_no || "", editable: false }, |
|
|
|
{ name: "Registration number", value: organisation.housing_registration_no || "", editable: false }, |
|
|
|
{ name: "Type of provider", value: organisation.display_provider_type, editable: false }, |
|
|
|
{ name: "Type of provider", value: organisation.display_provider_type, editable: false }, |
|
|
|
{ name: "Owns housing stock", value: organisation.holds_own_stock ? "Yes" : "No", editable: false }, |
|
|
|
{ name: "Owns housing stock", value: organisation.holds_own_stock ? "Yes" : "No", editable: false }, |
|
|
|
{ name: "Rent periods", value: organisation.rent_period_labels, editable: true, format: :bullet }, |
|
|
|
{ name: "Part of group", value: organisation.group_member ? "Yes" : "No", editable: current_user.support? }, |
|
|
|
{ name: "Data Sharing Agreement" }, |
|
|
|
|
|
|
|
{ name: "Status", value: status_tag(organisation.status) + delete_organisation_text(organisation), editable: false }, |
|
|
|
|
|
|
|
] |
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if organisation.group_member |
|
|
|
|
|
|
|
attributes << { name: "Group number", value: organisation.group, editable: current_user.support? } |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
attributes << { name: "For profit", value: organisation.profit_status, editable: current_user.support? } |
|
|
|
|
|
|
|
attributes << { name: "Rent periods", value: organisation.rent_period_labels, editable: true, format: :bullet } |
|
|
|
|
|
|
|
attributes << { name: "Data Sharing Agreement" } |
|
|
|
|
|
|
|
attributes << { name: "Status", value: status_tag(organisation.status) + delete_organisation_text(organisation), editable: false } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
attributes |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def organisation_name_row(user:, organisation:, summary_list:) |
|
|
|
def organisation_name_row(user:, organisation:, summary_list:) |
|
|
@ -64,6 +73,7 @@ module OrganisationsHelper |
|
|
|
def organisation_details_link_message(attribute) |
|
|
|
def organisation_details_link_message(attribute) |
|
|
|
text = lowercase_first_letter(attribute[:name]) |
|
|
|
text = lowercase_first_letter(attribute[:name]) |
|
|
|
return "Add #{text}" if attribute[:name] == "Rent periods" |
|
|
|
return "Add #{text}" if attribute[:name] == "Rent periods" |
|
|
|
|
|
|
|
return "Select profit status" if attribute[:name] == "For profit" |
|
|
|
|
|
|
|
|
|
|
|
"Enter #{text}" |
|
|
|
"Enter #{text}" |
|
|
|
end |
|
|
|
end |
|
|
|