Don't set venue related values without a venue
This commit is contained in:
parent
6b57c0be05
commit
56838b6eb0
2 changed files with 17 additions and 13 deletions
|
|
@ -91,12 +91,14 @@ class ConferencesController < ApplicationController
|
||||||
e.uid = conf.guid
|
e.uid = conf.guid
|
||||||
e.url = conference_url(conf.short_title)
|
e.url = conference_url(conf.short_title)
|
||||||
v = conf.venue
|
v = conf.venue
|
||||||
e.geo = v.latitude, v.longitude if v.latitude && v.longitude
|
if v
|
||||||
location = ''
|
e.geo = v.latitude, v.longitude if v.latitude && v.longitude
|
||||||
location += "#{v.street}, " if v.street
|
location = ''
|
||||||
location += "#{v.postalcode} #{v.city}, " if v.postalcode && v.city
|
location += "#{v.street}, " if v.street
|
||||||
location += v.country_name if v.country_name
|
location += "#{v.postalcode} #{v.city}, " if v.postalcode && v.city
|
||||||
e.location = location if location
|
location += v.country_name if v.country_name
|
||||||
|
e.location = location if location
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -36,13 +36,15 @@ module ConferenceHelper
|
||||||
e.uid = proposal.guid
|
e.uid = proposal.guid
|
||||||
e.url = conference_program_proposal_url(conference.short_title, proposal.id)
|
e.url = conference_program_proposal_url(conference.short_title, proposal.id)
|
||||||
v = conference.venue
|
v = conference.venue
|
||||||
e.geo = v.latitude, v.longitude if v.latitude && v.longitude
|
if v
|
||||||
location = ''
|
e.geo = v.latitude, v.longitude if v.latitude && v.longitude
|
||||||
location += "#{proposal.room.name} - " if proposal.room.name
|
location = ''
|
||||||
location += " - #{v.street}, " if v.street
|
location += "#{proposal.room.name} - " if proposal.room.name
|
||||||
location += "#{v.postalcode} #{v.city}, " if v.postalcode && v.city
|
location += " - #{v.street}, " if v.street
|
||||||
location += "#{v.country_name}, " if v.country_name
|
location += "#{v.postalcode} #{v.city}, " if v.postalcode && v.city
|
||||||
e.location = location
|
location += "#{v.country_name}, " if v.country_name
|
||||||
|
e.location = location
|
||||||
|
end
|
||||||
e.categories = conference.title, "Difficulty: #{proposal.difficulty_level.title}", "Track: #{proposal.track.name}"
|
e.categories = conference.title, "Difficulty: #{proposal.difficulty_level.title}", "Track: #{proposal.track.name}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue