From 1a1c5edab465b49c4042d83e463bb3ddb24c2db3 Mon Sep 17 00:00:00 2001 From: David Ormsbee Date: Sun, 2 Sep 2012 16:56:17 -0400 Subject: [PATCH 1/3] Completely cosmetic fix to make the indentation clearer. --- .../courseware/course_navigation.html | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/lms/templates/courseware/course_navigation.html b/lms/templates/courseware/course_navigation.html index 5df09207b1..92c9632625 100644 --- a/lms/templates/courseware/course_navigation.html +++ b/lms/templates/courseware/course_navigation.html @@ -19,34 +19,34 @@ def url_class(url):
  1. Courseware
  2. Course Info
  3. -% if hasattr(course,'syllabus_present') and course.syllabus_present: + % if hasattr(course,'syllabus_present') and course.syllabus_present:
  4. Syllabus
  5. -% endif -% if user.is_authenticated(): - % if settings.MITX_FEATURES.get('ENABLE_TEXTBOOK'): + % endif + % if user.is_authenticated(): + % if settings.MITX_FEATURES.get('ENABLE_TEXTBOOK'): % for index, textbook in enumerate(course.textbooks):
  6. ${textbook.title}
  7. % endfor - % endif - % if settings.MITX_FEATURES.get('ENABLE_DISCUSSION_SERVICE'): + % endif + % if settings.MITX_FEATURES.get('ENABLE_DISCUSSION_SERVICE'):
  8. Discussion
  9. ##
  10. News
  11. - % endif - - % if settings.MITX_FEATURES.get('ENABLE_DISCUSSION'): -
  12. Discussion
  13. - % endif -% endif -% if settings.WIKI_ENABLED: -
  14. Wiki
  15. -% endif -% if user.is_authenticated(): -
  16. Progress
  17. -% endif -% if staff_access: -
  18. Instructor
  19. -% endif + % endif + % if settings.MITX_FEATURES.get('ENABLE_DISCUSSION'): +
  20. Discussion
  21. + % endif + % endif + + % if settings.WIKI_ENABLED: +
  22. Wiki
  23. + % endif + % if user.is_authenticated(): +
  24. Progress
  25. + % endif + % if staff_access: +
  26. Instructor
  27. + % endif
From 5194dc3177b357d150ee7727d12a271739c4ebc2 Mon Sep 17 00:00:00 2001 From: David Ormsbee Date: Sun, 2 Sep 2012 22:22:01 -0400 Subject: [PATCH 2/3] Add support for discussion_link attribute in course policy files as a kludge to support CS50's external forums --- common/lib/xmodule/xmodule/course_module.py | 9 +++++++++ lms/templates/courseware/course_navigation.html | 9 ++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/common/lib/xmodule/xmodule/course_module.py b/common/lib/xmodule/xmodule/course_module.py index 28668ef088..9ae6fc59b7 100644 --- a/common/lib/xmodule/xmodule/course_module.py +++ b/common/lib/xmodule/xmodule/course_module.py @@ -232,6 +232,15 @@ class CourseDescriptor(SequenceDescriptor): def info_sidebar_name(self): return self.metadata.get('info_sidebar_name', 'Course Handouts') + @property + def discussion_link(self): + """FIXME: This is a quick kludge to allow CS50 (and other courses) to + specify their own discussion forums as external links by specifying a + "discussion_link" in their policy JSON file. This should later get + folded in with Syllabus, Course Info, and additional Custom tabs in a + more sensible framework later.""" + return self.metadata.get('discussion_link', None) + @property def title(self): return self.display_name diff --git a/lms/templates/courseware/course_navigation.html b/lms/templates/courseware/course_navigation.html index 92c9632625..f7dac9012e 100644 --- a/lms/templates/courseware/course_navigation.html +++ b/lms/templates/courseware/course_navigation.html @@ -28,11 +28,18 @@ def url_class(url):
  • ${textbook.title}
  • % endfor % endif - % if settings.MITX_FEATURES.get('ENABLE_DISCUSSION_SERVICE'): + + ## If they have a discussion link specified, use that even if we feature + ## flag discussions off. Disabling that is mostly a server safety feature + ## at this point, and we don't need to worry about external sites. + % if course.discussion_link: +
  • Discussion
  • + % elif settings.MITX_FEATURES.get('ENABLE_DISCUSSION_SERVICE'):
  • Discussion
  • ##
  • News
  • % endif + ## This is Askbot, which we should be retiring soon... % if settings.MITX_FEATURES.get('ENABLE_DISCUSSION'):
  • Discussion
  • % endif From ea78559ad3603ece4555e3adfba2aaca7fb1117a Mon Sep 17 00:00:00 2001 From: David Ormsbee Date: Mon, 3 Sep 2012 10:47:15 -0400 Subject: [PATCH 3/3] Changed FIXME -> TODO in response to comments --- common/lib/xmodule/xmodule/course_module.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/lib/xmodule/xmodule/course_module.py b/common/lib/xmodule/xmodule/course_module.py index 9ae6fc59b7..6c8c20014c 100644 --- a/common/lib/xmodule/xmodule/course_module.py +++ b/common/lib/xmodule/xmodule/course_module.py @@ -234,7 +234,7 @@ class CourseDescriptor(SequenceDescriptor): @property def discussion_link(self): - """FIXME: This is a quick kludge to allow CS50 (and other courses) to + """TODO: This is a quick kludge to allow CS50 (and other courses) to specify their own discussion forums as external links by specifying a "discussion_link" in their policy JSON file. This should later get folded in with Syllabus, Course Info, and additional Custom tabs in a