Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 0 additions & 5 deletions app/controllers/components/course/achievements_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
class Course::AchievementsComponent < SimpleDelegator
include Course::ControllerComponentHost::Component

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

def self.gamified?
true
end
Expand All @@ -15,7 +11,6 @@ def sidebar_items
{
key: :achievements,
icon: :achievement,
title: I18n.t('course.achievement.achievements.sidebar_title'),
weight: 4,
path: course_achievements_path(current_course)
}
Expand Down
9 changes: 3 additions & 6 deletions app/controllers/components/course/announcements_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ class Course::AnnouncementsComponent < SimpleDelegator
include Course::ControllerComponentHost::Component
include Course::UnreadCountsConcern

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

def sidebar_items
main_sidebar_items + settings_sidebar_items
end
Expand All @@ -18,7 +14,7 @@ def main_sidebar_items
{
key: :announcements,
icon: :announcement,
title: settings.title || t('course.announcements.sidebar_title'),
title: settings.title,
weight: 1,
path: course_announcements_path(current_course),
unread: unread_announcements_count
Expand All @@ -29,7 +25,8 @@ def main_sidebar_items
def settings_sidebar_items
[
{
title: settings.title || t('layouts.course_admin.announcement_settings.title'),
key: self.class.key,
title: settings.title,
type: :settings,
weight: 4,
path: course_admin_announcements_path(current_course)
Expand Down
10 changes: 2 additions & 8 deletions app/controllers/components/course/assessments_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ class Course::AssessmentsComponent < SimpleDelegator
include Course::ControllerComponentHost::Component
include Course::UnreadCountsConcern

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

def self.lesson_plan_item_actable_names
[Course::Assessment.name]
end
Expand Down Expand Up @@ -38,7 +34,6 @@ def assessment_submissions
{
key: :assessments_submissions,
icon: :submission,
title: t('course.assessment.submissions.sidebar_title'),
weight: 3,
path: course_submissions_path(current_course),
unread: pending_assessment_submissions_count
Expand All @@ -51,9 +46,8 @@ def admin_sidebar_items

[
{
key: :assessments_skills,
key: :sidebar_assessments_skills,
icon: :skills,
title: t('course.assessment.skills.sidebar_title'),
type: :admin,
weight: 8,
path: course_assessments_skills_path(current_course)
Expand All @@ -64,7 +58,7 @@ def admin_sidebar_items
def admin_settings_items
[
{
title: t('course.assessment.assessments.sidebar_title'),
key: self.class.key,
type: :settings,
weight: 5,
path: course_admin_assessments_path(current_course)
Expand Down
6 changes: 1 addition & 5 deletions app/controllers/components/course/codaveri_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
class Course::CodaveriComponent < SimpleDelegator
include Course::ControllerComponentHost::Component

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

def sidebar_items
settings_sidebar_items
end
Expand All @@ -15,7 +11,7 @@ def sidebar_items
def settings_sidebar_items
[
{
title: t('layouts.course_admin.codaveri.title'),
key: self.class.key,
type: :settings,
weight: 6,
path: course_admin_codaveri_path(current_course)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ class Course::Discussion::TopicsComponent < SimpleDelegator
include Course::ControllerComponentHost::Component
include Course::UnreadCountsConcern

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

def sidebar_items
main_sidebar_items + settings_sidebar_items
end
Expand All @@ -18,7 +14,7 @@ def main_sidebar_items
{
key: :discussion_topics,
icon: :comments,
title: settings.title || t('course.discussion.topics.sidebar_title'),
title: settings.title,
weight: 5,
path: course_topics_path(current_course),
unread: unread_comments_count
Expand All @@ -29,7 +25,8 @@ def main_sidebar_items
def settings_sidebar_items
[
{
title: settings.title || t('course.discussion.topics.sidebar_title'),
key: :sidebar_discussion_topics,
title: settings.title,
type: :settings,
weight: 7,
path: course_admin_topics_path(current_course)
Expand Down
7 changes: 1 addition & 6 deletions app/controllers/components/course/duplication_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,13 @@
class Course::DuplicationComponent < SimpleDelegator
include Course::ControllerComponentHost::Component

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

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

[
{
key: :duplication,
key: :admin_duplication,
icon: :duplication,
title: t('layouts.duplication.title'),
type: :admin,
weight: 5,
path: course_duplication_path(current_course)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,13 @@ def self.gamified?
true
end

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

def sidebar_items
return [] unless can_create_experience_points_record?

[
{
key: :experience_points,
key: :sidebar_experience_points,
icon: :experience,
title: t('course.experience_points.disbursement.sidebar_title'),
type: :admin,
weight: 4,
path: course_experience_points_records_path(current_course)
Expand Down
9 changes: 3 additions & 6 deletions app/controllers/components/course/forums_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ class Course::ForumsComponent < SimpleDelegator
include Course::ControllerComponentHost::Component
include Course::UnreadCountsConcern

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

def sidebar_items
main_sidebar_items + settings_sidebar_items
end
Expand All @@ -18,7 +14,7 @@ def main_sidebar_items
{
key: :forums,
icon: :forum,
title: settings.title || t('course.forum.forums.sidebar_title'),
title: settings.title,
weight: 10,
path: course_forums_path(current_course),
unread: unread_forum_topics_count
Expand All @@ -29,7 +25,8 @@ def main_sidebar_items
def settings_sidebar_items
[
{
title: settings.title || t('course.forum.forums.sidebar_title'),
key: self.class.key,
title: settings.title,
type: :settings,
weight: 11,
path: course_admin_forums_path(current_course)
Expand Down
7 changes: 1 addition & 6 deletions app/controllers/components/course/groups_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,13 @@ class Course::GroupsComponent < SimpleDelegator
include Course::ControllerComponentHost::Component
include Course::Group::GroupManagerConcern

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

def sidebar_items
return [] unless show_group_sidebar_item?

[
{
key: :groups,
key: self.class.key,
icon: :groups,
title: I18n.t('course.groups.sidebar_title'),
type: :admin,
weight: 7,
path: group_category_url
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
class Course::KoditsuPlatformComponent < SimpleDelegator
include Course::ControllerComponentHost::Component

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

def self.enabled_by_default?
false
end
Expand Down
9 changes: 3 additions & 6 deletions app/controllers/components/course/leaderboard_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
class Course::LeaderboardComponent < SimpleDelegator
include Course::ControllerComponentHost::Component

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

def self.gamified?
true
end
Expand All @@ -21,7 +17,7 @@ def main_sidebar_items
{
key: :leaderboard,
icon: :leaderboard,
title: settings.title || t('course.leaderboards.sidebar_title'),
title: settings.title,
weight: 6,
path: course_leaderboard_path(current_course)
}
Expand All @@ -31,7 +27,8 @@ def main_sidebar_items
def settings_sidebar_items
[
{
title: settings.title || t('course.leaderboards.title'),
key: self.class.key,
title: settings.title,
type: :settings,
weight: 8,
path: course_admin_leaderboard_path(current_course)
Expand Down
5 changes: 0 additions & 5 deletions app/controllers/components/course/learning_map_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,11 @@ def self.enabled_by_default?
false
end

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

def sidebar_items
[
{
key: :learning_map,
icon: :map,
title: t('layouts.learning_map.title'),
weight: 5,
path: course_learning_map_path(current_course)
}
Expand Down
7 changes: 1 addition & 6 deletions app/controllers/components/course/lesson_plan_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
class Course::LessonPlanComponent < SimpleDelegator
include Course::ControllerComponentHost::Component

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

def self.lesson_plan_item_actable_names
[Course::LessonPlan::Event.name]
end
Expand All @@ -21,7 +17,6 @@ def main_sidebar_items
{
key: :lesson_plan,
icon: :lessonPlan,
title: I18n.t('course.lesson_plan.items.sidebar_title'),
weight: 8,
path: course_lesson_plan_path(current_course)
}
Expand All @@ -31,7 +26,7 @@ def main_sidebar_items
def settings_sidebar_items
[
{
title: t('layouts.course_admin.lesson_plan.title'),
key: self.class.key,
type: :settings,
weight: 9,
path: course_admin_lesson_plan_path(current_course)
Expand Down
7 changes: 1 addition & 6 deletions app/controllers/components/course/levels_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
class Course::LevelsComponent < SimpleDelegator
include Course::ControllerComponentHost::Component

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

def self.gamified?
true
end
Expand All @@ -15,9 +11,8 @@ def sidebar_items

[
{
key: :levels,
key: self.class.key,
icon: :levels,
title: I18n.t('course.levels.sidebar_title'),
type: :admin,
weight: 6,
path: course_levels_path(current_course)
Expand Down
9 changes: 3 additions & 6 deletions app/controllers/components/course/materials_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
class Course::MaterialsComponent < SimpleDelegator
include Course::ControllerComponentHost::Component

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

def sidebar_items
main_sidebar_items + settings_sidebar_items
end
Expand All @@ -17,7 +13,7 @@ def main_sidebar_items
{
key: :materials,
icon: :material,
title: settings.title || t('course.material.sidebar_title'),
title: settings.title,
weight: 9,
path: course_material_folders_path(current_course)
}
Expand All @@ -27,7 +23,8 @@ def main_sidebar_items
def settings_sidebar_items
[
{
title: settings.title || t('course.material.sidebar_title'),
key: self.class.key,
title: settings.title,
type: :settings,
weight: 10,
path: course_admin_materials_path(current_course)
Expand Down
4 changes: 0 additions & 4 deletions app/controllers/components/course/monitoring_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
class Course::MonitoringComponent < SimpleDelegator
include Course::ControllerComponentHost::Component

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

def self.enabled_by_default?
false
end
Expand Down
Loading