agenda-libre-ruby/app/helpers/events_helper.rb

27 lines
775 B
Ruby
Raw Normal View History

# Helper for the event views
2013-12-28 23:45:13 +01:00
module EventsHelper
def set_events_meta
set_meta_tags \
description: t('layouts.application.subtitle'),
keywords: @events.pluck(:tags).join(' ').split.group_by { |i| i }
.reject { |_k, v| v.size < 2 }.map { |k, _v| k },
DC: {
title: t('layouts.application.title'),
subject: t('layouts.application.subtitle'),
publisher: 'april'
}
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