feat: Add course-wide custom scripts

Imlements OEP-15 by adding two fields to the course settings:
- Course-wide Custom JS
- Course-wide Custom CSS
The resources defined in these fields will be rendered in all course pages.

Rebase b6cb629849..0578e1c4c6 onto b6cb629849:
- Add course-wide resources to API for MFE use
- Revert "Add course-wide resources to API for MFE use" reverts commit 53648dcf0afe3cd171c9dc2eb5e56b871b2bcfb2

Signed-off-by: Gabor Boros <gabor.brs@gmail.com>
This commit is contained in:
ha-D
2021-08-05 12:26:51 +00:00
committed by Braden MacDonald
parent 210f911395
commit d3bc4601ae
6 changed files with 102 additions and 1 deletions

View File

@@ -998,6 +998,19 @@ class CourseFields: # lint-amnesty, pylint: disable=missing-class-docstring
),
scope=Scope.settings, default=False
)
course_wide_js = List(
display_name=_("Course-wide Custom JS"),
help=_('Enter Javascript resource URLs you want to be loaded globally throughout the course pages.'),
scope=Scope.settings,
)
course_wide_css = List(
display_name=_("Course-wide Custom CSS"),
help=_('Enter CSS resource URLs you want to be loaded globally throughout the course pages.'),
scope=Scope.settings,
)
other_course_settings = Dict(
display_name=_("Other Course Settings"),
help=_(