diff --git a/common/lib/xmodule/xmodule/course_module.py b/common/lib/xmodule/xmodule/course_module.py index 884dc40df2..e00e62a7c0 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'] @@ -86,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/static/js/toggle_login_modal.js b/lms/static/js/toggle_login_modal.js index 59d83a0dad..a92c616245 100644 --- a/lms/static/js/toggle_login_modal.js +++ b/lms/static/js/toggle_login_modal.js @@ -48,6 +48,11 @@ }) $(modal_id).fadeTo(200,1); + $(modal_id).find(".notice").hide().html(""); + var notice = $(this).data('notice') + if(notice !== undefined) { + $(modal_id).find(".notice").show().html(notice); + } e.preventDefault(); }); diff --git a/lms/static/sass/shared/_modal.scss b/lms/static/sass/shared/_modal.scss index 4113eb7f41..1ac3bbcbb2 100644 --- a/lms/static/sass/shared/_modal.scss +++ b/lms/static/sass/shared/_modal.scss @@ -115,7 +115,16 @@ padding: 12px; } - .activation-message, .message { + .activation-message, .message, .notice { + background: $yellow; + border: 1px solid darken($yellow, 60%); + color: darken($yellow, 60%); + display: none; + margin-bottom: 20px; + padding: 12px; + } + + .activation-message { padding: 0 40px 10px; p { 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}
diff --git a/lms/templates/portal/course_about.html b/lms/templates/portal/course_about.html index 112333694f..51e769a3a4 100644 --- a/lms/templates/portal/course_about.html +++ b/lms/templates/portal/course_about.html @@ -15,16 +15,22 @@
- Register + %if user.is_authenticated(): + Register + %else: + Register + %endif
+ % if course.get_about_section("video"):
+ % endif @@ -62,7 +68,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. diff --git a/lms/templates/signup_modal.html b/lms/templates/signup_modal.html index 3ab940c58e..d22dc8e9a0 100644 --- a/lms/templates/signup_modal.html +++ b/lms/templates/signup_modal.html @@ -10,7 +10,9 @@
    +
    +