From a12e628fb1189a9884545a503e40a68e5baeff50 Mon Sep 17 00:00:00 2001 From: David Ormsbee Date: Tue, 17 Jul 2012 22:52:19 -0400 Subject: [PATCH 1/3] Display real course start date in course about page --- common/lib/xmodule/xmodule/course_module.py | 6 +++++- lms/templates/portal/course_about.html | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/common/lib/xmodule/xmodule/course_module.py b/common/lib/xmodule/xmodule/course_module.py index 884dc40df2..c7dc77d5ac 100644 --- a/common/lib/xmodule/xmodule/course_module.py +++ b/common/lib/xmodule/xmodule/course_module.py @@ -29,7 +29,7 @@ class CourseDescriptor(SequenceDescriptor): def has_started(self): return time.gmtime() > self.start - + @classmethod def id_to_location(cls, course_id): org, course, name = course_id.split('/') @@ -39,6 +39,10 @@ class CourseDescriptor(SequenceDescriptor): def id(self): return "/".join([self.location.org, self.location.course, self.location.name]) + @property + def start_date_text(self): + return time.strftime("%m/%d/%y", self.start) + @property def title(self): return self.metadata['display_name'] diff --git a/lms/templates/portal/course_about.html b/lms/templates/portal/course_about.html index 112333694f..30980c41ed 100644 --- a/lms/templates/portal/course_about.html +++ b/lms/templates/portal/course_about.html @@ -62,7 +62,7 @@
    -
  1. Classes Start

    7/12/12
  2. +
  3. Classes Start

    ${course.start_date_text}
  4. ##
  5. Final Exam

    12/09/12
  6. ##
  7. Course Length

    15 weeks
  8. Course Number

    ${course.number}
  9. From 6eccf99aca81948c19dc8550d53a95138909386c Mon Sep 17 00:00:00 2001 From: David Ormsbee Date: Tue, 17 Jul 2012 23:50:18 -0400 Subject: [PATCH 2/3] Add course start dates to course boxes in courses list view. --- lms/templates/course.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lms/templates/course.html b/lms/templates/course.html index 37a25c7526..c22ff349ea 100644 --- a/lms/templates/course.html +++ b/lms/templates/course.html @@ -23,7 +23,7 @@
    ${course.get_about_section('university')} - 7/23/12 + ${course.start_date_text}
    From 8768189db120c7bd5f9d55763890d7d8044e563a Mon Sep 17 00:00:00 2001 From: David Ormsbee Date: Wed, 18 Jul 2012 01:29:00 -0400 Subject: [PATCH 3/3] Video slot only appears in course about page if there is a video (note: url is still fixed). --- common/lib/xmodule/xmodule/course_module.py | 4 ++-- lms/templates/portal/course_about.html | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/common/lib/xmodule/xmodule/course_module.py b/common/lib/xmodule/xmodule/course_module.py index c7dc77d5ac..e00e62a7c0 100644 --- a/common/lib/xmodule/xmodule/course_module.py +++ b/common/lib/xmodule/xmodule/course_module.py @@ -90,8 +90,8 @@ class CourseDescriptor(SequenceDescriptor): with self.system.resources_fs.open(path("about") / section_key + ".html") as htmlFile: return htmlFile.read().decode('utf-8') except ResourceNotFoundError: - log.exception("Missing about section {key} in course {url}".format(key=section_key, url=self.location.url())) - return "! About section missing !" + log.warning("Missing about section {key} in course {url}".format(key=section_key, url=self.location.url())) + return None elif section_key == "title": return self.metadata.get('display_name', self.name) elif section_key == "university": diff --git a/lms/templates/portal/course_about.html b/lms/templates/portal/course_about.html index 30980c41ed..e47dd96c60 100644 --- a/lms/templates/portal/course_about.html +++ b/lms/templates/portal/course_about.html @@ -19,12 +19,14 @@ + % if course.get_about_section("video"):
    + % endif