Module: Course::Material::FoldersHelper

Defined in:
app/helpers/course/material/folders_helper.rb

Instance Method Summary collapse

Instance Method Details

#display_folder(folder) ⇒ String

Find the proper display name for the folder, if folder is root we will display the name of material component.

Parameters:

Returns:

  • (String)

    The proper display name of the folder.


8
9
10
# File 'app/helpers/course/material/folders_helper.rb', line 8

def display_folder(folder)
  folder.root? ? component.settings.title || t('course.material.sidebar_title') : folder.name
end

#show_sdl_warning?(folder) ⇒ Boolean

Display an icon when the folder's start_at is in the future, but the course's advance_start_at option already makes it visible to students.

Parameters:

Returns:

  • (Boolean)

    Whether the icon should be displayed.


17
18
19
# File 'app/helpers/course/material/folders_helper.rb', line 17

def show_sdl_warning?(folder)
  folder.effective_start_at < Time.zone.now && folder.start_at > Time.zone.now
end