Module: Course::VirtualClassroomsHelper

Defined in:
app/helpers/course/virtual_classrooms_helper.rb

Instance Method Summary collapse

Instance Method Details

#duration_options[String, Integer]

Generate select options for virtual classroom duration

Returns:

  • ([String, Integer])

    Formatted select options, starting from 15 minutes, with a 15-minute interval, up to max_duration (inclusive) set in virtual_classroom component settings


16
17
18
19
20
# File 'app/helpers/course/virtual_classrooms_helper.rb', line 16

def duration_options
  (15..@settings.max_duration.to_i).step(15).map do |i|
    [I18n.t('course.virtual_classrooms.index.duration_minutes', duration: i), i]
  end
end

#list_recorded_videos(virtual_classroom) ⇒ Object


22
23
24
25
26
27
28
# File 'app/helpers/course/virtual_classrooms_helper.rb', line 22

def list_recorded_videos(virtual_classroom)
   :p do
    result = (:span, t('course.virtual_classrooms.recorded_videos') + ': ')
    result = recorded_video_links(result, virtual_classroom)
    result
  end
end

#virtual_classrooms_titleString?

Returns the formatted title of virtual classrooms component.

Returns:

  • (String)

    The formatted title of virtual classrooms component.

  • (nil)

    If the title is nil.


7
8
9
# File 'app/helpers/course/virtual_classrooms_helper.rb', line 7

def virtual_classrooms_title
  @settings.title.nil? ? nil : format_inline_text(@settings.title)
end