Class: Course::StatisticsComponent

Inherits:
SimpleDelegator
  • Object
show all
Includes:
ControllerComponentHost::Component
Defined in:
app/controllers/components/course/statistics_component.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.display_nameObject


5
6
7
# File 'app/controllers/components/course/statistics_component.rb', line 5

def self.display_name
  I18n.t('components.statistics.name')
end

Instance Method Details


9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'app/controllers/components/course/statistics_component.rb', line 9

def sidebar_items
  return [] unless can?(:read_statistics, current_course)

  [
    {
      key: :student_statistics,
      icon: 'bar-chart',
      title: t('course.statistics.student.header'),
      type: :admin,
      weight: 2,
      path: course_statistics_student_path(current_course)
    },
    {
      key: :staff_statistics,
      icon: 'bar-chart',
      title: I18n.t('course.statistics.staff.header'),
      type: :admin,
      weight: 3,
      path: course_statistics_staff_path(current_course)
    }
  ]
end