2014-08-06 14:47:47 +02:00
|
|
|
# Helper for the event views
|
2013-12-28 23:45:13 +01:00
|
|
|
module EventsHelper
|
2014-08-06 14:47:47 +02:00
|
|
|
def set_events_meta
|
|
|
|
set_meta_tags \
|
2014-08-09 18:59:11 +02:00
|
|
|
description: t('layouts.application.subtitle'),
|
2014-08-10 12:24:43 +02:00
|
|
|
keywords: @events.map { |e| e.tags }.join(' ').split.group_by { |i| i }
|
2014-08-06 14:47:47 +02:00
|
|
|
.reject { |_k, v| v.size < 2 }.map { |k, _v| k },
|
|
|
|
DC: {
|
|
|
|
title: t('layouts.application.title'),
|
2014-08-07 22:16:05 +02:00
|
|
|
subject: t('layouts.application.subtitle'),
|
|
|
|
publisher: 'april'
|
2014-08-06 14:47:47 +02:00
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
def set_event_meta
|
|
|
|
set_meta_tags \
|
|
|
|
keywords: @event.tags,
|
|
|
|
DC: { title: @event.title, date: @event.start_time.to_s },
|
|
|
|
geo: {
|
|
|
|
region: @event.related_region,
|
|
|
|
placename: @event.city,
|
|
|
|
position: "#{@event.related_city.try :latitude};" \
|
|
|
|
+ "#{@event.related_city.try :longitude}"
|
|
|
|
}
|
|
|
|
end
|
2013-12-28 23:45:13 +01:00
|
|
|
end
|