Skip to content

Commit 9492db9

Browse files
cokananmolpe
authored andcommitted
defined icon_for_event method
Signed-off-by: Alberto Molpeceres <alberto.molpeceres@gmail.com>
1 parent 42ece73 commit 9492db9

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

app/helpers/conclave/events_helper.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
module Conclave
22
module EventsHelper
33

4+
def icon_for_event(event, size, options={})
5+
if event.icon?
6+
photo_url = event.icon.url(size)
7+
options.merge!(:alt => I18n.t("tog_conclave.helper.photo_for_event", :name => event.title))
8+
return image_tag(photo_url, options) if photo_url
9+
else
10+
return image_tag("/tog_conclave/images/#{config["plugins.tog_conclave.image.default"]}" , options)
11+
end
12+
end
13+
414
def write_event_time(event)
515
"#{I18n.t('tog_conclave.site.from_time')} #{event.starting_time} #{I18n.t('tog_conclave.site.to_time')} #{event.ending_time}"
616
end

0 commit comments

Comments
 (0)