Add archived to dashboard and change homepage to only show active (ie not archived) courses
This commit is contained in:
@@ -15,6 +15,7 @@ class CourseDashboard < Administrate::BaseDashboard
|
||||
panopto_folders: Field::String.with_options(searchable: false),
|
||||
semester_start_date: Field::Date,
|
||||
title: Field::String,
|
||||
archived: Field::Boolean,
|
||||
homepage: Field::String,
|
||||
toggl_project: Field::Number,
|
||||
unit_code: Field::String,
|
||||
@@ -30,6 +31,7 @@ class CourseDashboard < Administrate::BaseDashboard
|
||||
COLLECTION_ATTRIBUTES = %i[
|
||||
title
|
||||
unit_code
|
||||
archived
|
||||
homepage
|
||||
lectures
|
||||
work_items
|
||||
@@ -42,6 +44,7 @@ class CourseDashboard < Administrate::BaseDashboard
|
||||
id
|
||||
title
|
||||
unit_code
|
||||
archived
|
||||
homepage
|
||||
panopto_folders
|
||||
semester_start_date
|
||||
@@ -59,6 +62,7 @@ class CourseDashboard < Administrate::BaseDashboard
|
||||
FORM_ATTRIBUTES = %i[
|
||||
title
|
||||
unit_code
|
||||
archived
|
||||
homepage
|
||||
panopto_folders
|
||||
semester_start_date
|
||||
@@ -75,7 +79,10 @@ class CourseDashboard < Administrate::BaseDashboard
|
||||
# COLLECTION_FILTERS = {
|
||||
# open: ->(resources) { resources.where(open: true) }
|
||||
# }.freeze
|
||||
COLLECTION_FILTERS = {}.freeze
|
||||
COLLECTION_FILTERS = {
|
||||
archived: ->(resources) { resources.where(archived: true) },
|
||||
active: ->(resources) { resources.where(archived: false) }
|
||||
}.freeze
|
||||
|
||||
# Overwrite this method to customize how courses are displayed
|
||||
# across all pages of the admin dashboard.
|
||||
|
||||
Reference in New Issue
Block a user