From 960cf5792b6265dc90d6d306b9a626a4169c6e67 Mon Sep 17 00:00:00 2001 From: kimth Date: Wed, 22 Aug 2012 15:12:49 -0400 Subject: [PATCH 1/2] Dynamically disable syllabus per-course --- common/lib/xmodule/xmodule/course_module.py | 5 +++++ lms/templates/courseware/course_navigation.html | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/common/lib/xmodule/xmodule/course_module.py b/common/lib/xmodule/xmodule/course_module.py index 5cc4a09165..f8496dd67c 100644 --- a/common/lib/xmodule/xmodule/course_module.py +++ b/common/lib/xmodule/xmodule/course_module.py @@ -3,6 +3,7 @@ import time import logging import requests from lxml import etree +from path import path # NOTE (THK): Only used for detecting presence of syllabus from xmodule.util.decorators import lazyproperty from xmodule.graders import load_grading_policy @@ -75,6 +76,10 @@ class CourseDescriptor(SequenceDescriptor): # NOTE: relies on the modulestore to call set_grading_policy() right after # init. (Modulestore is in charge of figuring out where to load the policy from) + # NOTE (THK): This is a last-minute addition for Fall 2012 launch to dynamically + # disable the syllabus content for courses that do not provide a syllabus + self.syllabus_present = self.system.resources_fs.exists(path('syllabus')) + def set_grading_policy(self, policy_str): """Parse the policy specified in policy_str, and save it""" diff --git a/lms/templates/courseware/course_navigation.html b/lms/templates/courseware/course_navigation.html index 63fec53c4c..af2100f042 100644 --- a/lms/templates/courseware/course_navigation.html +++ b/lms/templates/courseware/course_navigation.html @@ -19,7 +19,7 @@ def url_class(url):
  1. Courseware
  2. Course Info
  3. -% if settings.MITX_FEATURES.get('ENABLE_SYLLABUS'): +% if course.syllabus_present:
  4. Syllabus
  5. % endif % if user.is_authenticated(): From 64788a73aadf3787c9d04d6ce4b78e2270d0b533 Mon Sep 17 00:00:00 2001 From: kimth Date: Wed, 22 Aug 2012 15:22:58 -0400 Subject: [PATCH 2/2] Remove ENABLE_SYLLABUS flag from envs/common --- lms/envs/common.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lms/envs/common.py b/lms/envs/common.py index a217f0e7b9..bc49de6d76 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -55,10 +55,6 @@ MITX_FEATURES = { # course_ids (see dev_int.py for an example) 'SUBDOMAIN_COURSE_LISTINGS' : False, - # TODO: This will be removed once course-specific tabs are in place. see - # courseware/courses.py - 'ENABLE_SYLLABUS' : True, - 'ENABLE_TEXTBOOK' : True, 'ENABLE_DISCUSSION' : False, 'ENABLE_DISCUSSION_SERVICE': True,