Update property_hires_controller.rb show issue

This commit is contained in:
wmcheng 2019-06-14 01:26:53 +08:00
parent e1e90a83cf
commit cb4065aef7
1 changed files with 14 additions and 12 deletions

View File

@ -79,7 +79,7 @@ class PropertyHiresController < ApplicationController
"header" => t("property_hire.can_be_hired"), "header" => t("property_hire.can_be_hired"),
"value" => (property.can_be_hired ? "<span class='label label-success'>Yes</span>" : "<span class='label label-danger'>No</span>") "value" => (property.can_be_hired ? "<span class='label label-success'>Yes</span>" : "<span class='label label-danger'>No</span>")
} }
if !property_hire.purchase_date.blank? if !property_hire.purchase_date.to_s.blank?
data << { data << {
"header" => t("property_hire.purchase_date"), "header" => t("property_hire.purchase_date"),
"value" => property.purchase_date.strftime("%Y-%m-%d") "value" => property.purchase_date.strftime("%Y-%m-%d")
@ -90,34 +90,36 @@ class PropertyHiresController < ApplicationController
else else
owners = property.owner_profiles.collect{|mp| mp.name}.join(",") owners = property.owner_profiles.collect{|mp| mp.name}.join(",")
end end
if !property_hire.owners.blank? if !owners.blank?
data << { data << {
"header" => t("property_hire.owners"), "header" => t("property_hire.owners"),
"value" => owners "value" => owners
} }
end end
if !property_hire.owner_email.blank? if !property.owner_email.blank?
data << { data << {
"header" => t("property_hire.owner_email"), "header" => t("property_hire.owner_email"),
"value" => property.owner_email "value" => property.owner_email
} }
end end
if !property_hire.owner_phone.blank? if !property.owner_phone.blank?
data << { data << {
"header" => t("property_hire.owner_phone"), "header" => t("property_hire.owner_phone"),
"value" => property.owner_phone "value" => property.owner_phone
} }
end end
if !property_hire.price.blank? if !property.price.blank?
data << { data << {
"header" => t("property_hire.price"), "header" => t("property_hire.price"),
"value" => property.price "value" => property.price
} }
end end
data << { if !property.get_location_name.blank?
"header" => t("property_hire.location"), data << {
"value" => property.get_location_name "header" => t("property_hire.location"),
} "value" => property.get_location_name
}
end
actions = [] actions = []
if property.can_be_hired if property.can_be_hired
actions << { actions << {