Merge pull request #17362 from caesar2164/allow-about-sidebar-content-from-instructor
Add custom HTML to Course About page sidebar
This commit is contained in:
@@ -27,6 +27,7 @@ ABOUT_ATTRIBUTES = [
|
||||
'entrance_exam_enabled',
|
||||
'entrance_exam_id',
|
||||
'entrance_exam_minimum_score_pct',
|
||||
'about_sidebar_html',
|
||||
]
|
||||
|
||||
|
||||
@@ -52,6 +53,7 @@ class CourseDetails(object):
|
||||
self.description = ""
|
||||
self.short_description = ""
|
||||
self.overview = "" # html to render as the overview
|
||||
self.about_sidebar_html = ""
|
||||
self.intro_video = None # a video pointer
|
||||
self.effort = None # hours/week
|
||||
self.license = "all-rights-reserved" # default course license is all rights reserved
|
||||
|
||||
@@ -72,6 +72,11 @@ class CourseDetailsTestCase(ModuleStoreTestCase):
|
||||
CourseDetails.update_from_json(self.course.id, jsondetails.__dict__, self.user).intro_video,
|
||||
jsondetails.intro_video, "After set intro_video"
|
||||
)
|
||||
jsondetails.about_sidebar_html = "About Sidebar HTML"
|
||||
self.assertEqual(
|
||||
CourseDetails.update_from_json(self.course.id, jsondetails.__dict__, self.user).about_sidebar_html,
|
||||
jsondetails.about_sidebar_html, "After set about_sidebar_html"
|
||||
)
|
||||
jsondetails.effort = "effort"
|
||||
self.assertEqual(
|
||||
CourseDetails.update_from_json(self.course.id, jsondetails.__dict__, self.user).effort,
|
||||
|
||||
17
openedx/features/course_experience/waffle.py
Normal file
17
openedx/features/course_experience/waffle.py
Normal file
@@ -0,0 +1,17 @@
|
||||
"""
|
||||
Miscellaneous waffle switches that both LMS and Studio need to access
|
||||
"""
|
||||
from openedx.core.djangoapps.waffle_utils import WaffleSwitchNamespace
|
||||
|
||||
# Namespace
|
||||
WAFFLE_NAMESPACE = u'course_experience'
|
||||
|
||||
# Switches
|
||||
ENABLE_COURSE_ABOUT_SIDEBAR_HTML = u'enable_about_sidebar_html'
|
||||
|
||||
|
||||
def waffle():
|
||||
"""
|
||||
Returns the namespaced, cached, audited shared Waffle Switch class.
|
||||
"""
|
||||
return WaffleSwitchNamespace(name=WAFFLE_NAMESPACE, log_prefix=u'Course Experience: ')
|
||||
Reference in New Issue
Block a user