diff --git a/common/lib/xmodule/xmodule/course_module.py b/common/lib/xmodule/xmodule/course_module.py index 58e0ea11ed..3896affca1 100644 --- a/common/lib/xmodule/xmodule/course_module.py +++ b/common/lib/xmodule/xmodule/course_module.py @@ -210,6 +210,19 @@ class CourseDescriptor(SequenceDescriptor): def start_date_text(self): return time.strftime("%b %d, %Y", self.start) + # An extra property is used rather than the wiki_slug/number because + # there are courses that change the number for different runs. This allows + # courses to share the same css_class across runs even if they have + # different numbers. + # + # TODO get rid of this as soon as possible or potentially build in a robust + # way to add in course-specific styling. There needs to be a discussion + # about the right way to do this, but arjun will address this ASAP. Also + # note that the courseware template needs to change when this is removed. + @property + def css_class(self): + return self.metadata.get('css_class', '') + @property def title(self): return self.display_name diff --git a/lms/templates/courseware/courseware.html b/lms/templates/courseware/courseware.html index d5bdb9b302..58998d7c1d 100644 --- a/lms/templates/courseware/courseware.html +++ b/lms/templates/courseware/courseware.html @@ -1,6 +1,6 @@ <%inherit file="/main.html" /> <%namespace name='static' file='/static_content.html'/> -<%block name="bodyclass">courseware +<%block name="bodyclass">courseware ${course.css_class} <%block name="title">${course.number} Courseware <%block name="headextra">