Added house rules to housing admin and review

This commit is contained in:
Godwin
2017-08-05 19:19:46 -07:00
parent 365733ba6d
commit 2185129e55
9 changed files with 59 additions and 57 deletions
+8 -2
View File
@@ -85,8 +85,14 @@ module GeocoderHelper
end
def location_link(location)
return '' unless location.present? && location.address.present?
content_tag(:a, (_!location.address), href: "http://www.google.com/maps/place/#{location.latitude},#{location.longitude}")
return '' unless location.present?
address = if location.is_a?(Location)
location.street
else
location.address
end
return '' unless address.present?
content_tag(:a, (_!address), href: "http://www.google.com/maps/place/#{location.latitude},#{location.longitude}")
end
def same_city?(location1, location2)
+4 -4
View File
@@ -112,20 +112,20 @@ module WidgetsHelper
@housing_data[id][:guest_data][guest_id][:errors].each do |error, value|
if value.is_a?(Array)
value.each do |v|
status_html += content_tag(:li, _("errors.messages.housing.space.#{error.to_s}", vars: v))
status_html += content_tag(:li, _("errors.messages.housing.space.#{error.to_s}", vars: v).html_safe)
end
else
status_html += content_tag(:li, _("errors.messages.housing.space.#{error.to_s}", vars: value))
status_html += content_tag(:li, _("errors.messages.housing.space.#{error.to_s}", vars: value).html_safe)
end
end
@housing_data[id][:guest_data][guest_id][:warnings].each do |error, value|
if value.is_a?(Array)
value.each do |v|
status_html += content_tag(:li, _("warnings.messages.housing.space.#{error.to_s}", v))
status_html += content_tag(:li, _("warnings.messages.housing.space.#{error.to_s}", v).html_safe)
end
else
status_html += content_tag(:li, _("warnings.messages.housing.space.#{error.to_s}", vars: value))
status_html += content_tag(:li, _("warnings.messages.housing.space.#{error.to_s}", vars: value).html_safe)
end
end