Module: EventsHelper

Defined in:
app/helpers/events_helper.rb

Instance Method Summary collapse

Instance Method Details


21
22
23
24
# File 'app/helpers/events_helper.rb', line 21

def all_events_rss_link
  fa_icon('rss') + ' ' +
  link_to(t('events.rss'), events_url(format: :xml))
end

16
17
18
19
# File 'app/helpers/events_helper.rb', line 16

def all_events_webcal_link
  fa_icon('calendar') + ' ' +
  link_to(t('events.webcal'), events_url(format: :ics, protocol: "webcal"))
end

26
27
28
29
# File 'app/helpers/events_helper.rb', line 26

def events_im_attending_link
  fa_icon('calendar') + ' ' +
  link_to(t('events.webcal'), calendar_user_url(id: current_user, format: :ics, protocol: "webcal"))
end

2
3
4
5
6
7
8
9
10
11
12
13
14
# File 'app/helpers/events_helper.rb', line 2

def participation_link(event)
  if signed_in?
    if current_user.participates?(event)
      button_to t("show.not_attend"), [event, current_user.participation(event)], method: :delete
    elsif event.closed?
      button_to t("show.attend"), "#", data: {disable: t("flash.already_closed")}
    else
      button_to t("show.attend"), [event, Participant.new]
    end
  else
    button_to t("show.attend"), "#", data: {disable: t("show.login_before_attend")}
  end
end