Module EventsHelper
In: app/helpers/events_helper.rb

Methods

Public Instance methods

Muestra la información sobre la cobertura que de OpenIrekia al evento.

[Source]

    # File app/helpers/events_helper.rb, line 15
15:   def coverage_and_streaming_for(event, where="agencia")
16:     txt = ""
17:     cov_types = []
18:     if where.eql?('irekia')
19:       if event.streaming_live?
20:         cov_types << t("events.streaming_for_irekia") if event.send("streaming_for_irekia?")       
21:       end      
22:     else
23:       items = ["irekia_coverage_audio", "irekia_coverage_video", "irekia_coverage_photo"]
24:       if event.irekia_coverage? || event.streaming_live?
25:         items.each do |cov_type|
26:           cov_types << t("events.#{cov_type}") if event.send("#{cov_type}?")
27:         end
28:         if where.eql?('all')
29:           ss = event.streaming_for_pretty(@locale)
30:           cov_types << t("events.streaming_for_subsites", :subsites => ss) if ss.present?
31:         else
32:           cov_type = "streaming_for_#{subsite}"
33:           cov_types << t("events.#{cov_type}") if event.send("#{cov_type}?")
34:         end
35:         
36:       end
37:     end
38:     
39:     if where.eql?('all')
40:       cov_type = 'irekia_coverage_article'
41:       # mostrar el info sobre la crónica también
42:       cov_types << t("events.#{cov_type}") if event.send("#{cov_type}?")
43:     end
44:     
45:     unless cov_types.empty?
46:       # cov_types_str = cov_types.length > 1 ? "#{cov_types[0..-2].join(', ')} #{t('y')} #{cov_types[-1]}" : cov_types.join(', ')
47:       cov_types_str = cov_types.to_sentence
48:       txt = content_tag where.eql?('irekia') ? :div : :p, :class => "coverage c4#{where}" do
49:         content_tag(:span, t('events.irekia_coverage', :cov_types => cov_types_str), :class => 'marked')+ (event.on_air?(subsite) ? content_tag(:div, link_to(t('events.ver_streaming'), subsite.eql?('agencia') ? ma_event_path(event) : event_path(event)), :class => 'go2streaming') : "")
50:       end
51:     end
52:     
53:     txt
54:   end

[Source]

    # File app/helpers/events_helper.rb, line 56
56:   def event_location_pretty(event)
57:     txt = h(event.pretty_place)
58:     txt += "<br/>#{h(event.location_for_gmaps)}" if event.location_for_gmaps.present?
59:     
60:     content_tag(:span, txt, :class => "location")
61:   end

[Source]

     # File app/helpers/events_helper.rb, line 112
112:   def show_events_list_with_calendar_icon(events)
113:     txt = ""
114:     events.each_with_index do |event, i|
115:       txt << render(:partial => 'event', :object => event, :locals => {:show_day_icon => show_day_icon?(events, event, i)})
116:     end 
117:     txt
118:   end

Devuelve true si hay que mostrar el link "Suscribirse" para la lista de eventos actual.

[Source]

     # File app/helpers/events_helper.rb, line 121
121:   def show_subscription_link
122:     @archive.eql?('f')
123:   end

Devuelve true si la ventana del streaming se puede usar por diferentes eventos, por ejemplo si está en el home de irekia o de la agencia, y false si sólo se usa para un evento, por ejemplo cuando estamos en la página del evento.

[Source]

    # File app/helpers/events_helper.rb, line 5
 5:   def streaming_window_is_shared?(subsite)
 6:     shared = false
 7:     if subsite.eql?('irekia') 
 8:       shared = @transparency.present?
 9:     else
10:       shared = params[:action].eql?('home')
11:     end
12:   end

[Source]

    # File app/helpers/events_helper.rb, line 63
63:   def subsite_event_link(event_or_stream_flow, current_subsite=nil)
64:     current_subsite ||= subsite
65:     link = event_or_stream_flow.title
66:     if event_or_stream_flow.is_a?(StreamFlow) 
67:       sf = event_or_stream_flow
68:       link = link_to(sf.title, send("#{subsite.eql?('agencia') ? 'ma_' : ''}streaming_path", sf))
69:     else
70:       event = event_or_stream_flow
71:       if current_subsite.eql?('irekia')
72:         if event.show_in_irekia?
73:           link = link_to(event.title, event_path(event))
74:         else
75:           link = link_to(event.title, streaming_path(event.stream_flow))
76:         end
77:       else
78:         if event.show_in_agencia?
79:           link = link_to(event.title, ma_event_path(event)) 
80:         else
81:           link = link_to(event.title, event_path(event)) if event.show_in_irekia?
82:         end
83:       end
84:     end
85:     link
86:   end

[Source]

     # File app/helpers/events_helper.rb, line 88
 88:   def subsite_streaming_url(event_or_stream_flow, current_subsite=nil)
 89:     current_subsite ||= subsite
 90:     link = ""
 91:     if event_or_stream_flow.is_a?(StreamFlow) 
 92:       link = send("#{subsite.eql?('agencia') ? 'ma_' : ''}streaming_path", event_or_stream_flow)
 93:     else
 94:       event = event_or_stream_flow
 95:       if current_subsite.eql?('irekia')
 96:         if event.show_in_irekia?
 97:           link = event_path(event)
 98:         else
 99:           link = streaming_path(event.stream_flow)
100:         end
101:       else
102:         if event.show_in_agencia?
103:           link = ma_event_path(event)
104:         else
105:           link = event_path(event) if event.show_in_irekia?
106:         end
107:       end
108:     end
109:     link
110:   end

[Validate]