From a12e628fb1189a9884545a503e40a68e5baeff50 Mon Sep 17 00:00:00 2001 From: David Ormsbee Date: Tue, 17 Jul 2012 22:52:19 -0400 Subject: [PATCH 1/6] 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/6] 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/6] 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 From c5d3efdf60d31a5d20bb4ded4469c3be5dbdac69 Mon Sep 17 00:00:00 2001 From: Matthew Mongeau Date: Tue, 17 Jul 2012 17:36:18 -0400 Subject: [PATCH 4/6] Show sign up form if not signed in. --- lms/static/js/toggle_login_modal.js | 4 ++++ lms/templates/portal/course_about.html | 6 +++++- lms/templates/signup_modal.html | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lms/static/js/toggle_login_modal.js b/lms/static/js/toggle_login_modal.js index 59d83a0dad..5301c893be 100644 --- a/lms/static/js/toggle_login_modal.js +++ b/lms/static/js/toggle_login_modal.js @@ -48,6 +48,10 @@ }) $(modal_id).fadeTo(200,1); + var notice = $(this).data('notice') + if(notice !== undefined) { + $(modal_id).find(".notice").show().html(notice); + } e.preventDefault(); }); diff --git a/lms/templates/portal/course_about.html b/lms/templates/portal/course_about.html index 112333694f..ac7b5c5a49 100644 --- a/lms/templates/portal/course_about.html +++ b/lms/templates/portal/course_about.html @@ -15,7 +15,11 @@
    - Register + %if user.is_authenticated(): + Register + %else: + Register + %endif
    diff --git a/lms/templates/signup_modal.html b/lms/templates/signup_modal.html index 3ab940c58e..e50f551c63 100644 --- a/lms/templates/signup_modal.html +++ b/lms/templates/signup_modal.html @@ -9,6 +9,7 @@
    +
    From 9bf4b11ae96084dc667893b0b055c7bccc27aaf1 Mon Sep 17 00:00:00 2001 From: Matthew Mongeau Date: Tue, 17 Jul 2012 18:15:29 -0400 Subject: [PATCH 5/6] Style notice. --- lms/static/js/toggle_login_modal.js | 1 + lms/static/sass/shared/_modal.scss | 13 +++++++++++++ lms/templates/signup_modal.html | 3 ++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/lms/static/js/toggle_login_modal.js b/lms/static/js/toggle_login_modal.js index 5301c893be..a92c616245 100644 --- a/lms/static/js/toggle_login_modal.js +++ b/lms/static/js/toggle_login_modal.js @@ -48,6 +48,7 @@ }) $(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); diff --git a/lms/static/sass/shared/_modal.scss b/lms/static/sass/shared/_modal.scss index 4113eb7f41..d95902d895 100644 --- a/lms/static/sass/shared/_modal.scss +++ b/lms/static/sass/shared/_modal.scss @@ -115,7 +115,20 @@ padding: 12px; } +<<<<<<< HEAD .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 { +>>>>>>> cb49d9c... Style notice. padding: 0 40px 10px; p { diff --git a/lms/templates/signup_modal.html b/lms/templates/signup_modal.html index e50f551c63..d22dc8e9a0 100644 --- a/lms/templates/signup_modal.html +++ b/lms/templates/signup_modal.html @@ -9,9 +9,10 @@
    -
    +
    +
    From 63fd5b57dddd500be39caa09af480ad44029e77c Mon Sep 17 00:00:00 2001 From: Matthew Mongeau Date: Wed, 18 Jul 2012 10:23:44 -0400 Subject: [PATCH 6/6] Fix _modal.scss merge conflicts. --- lms/static/sass/shared/_modal.scss | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lms/static/sass/shared/_modal.scss b/lms/static/sass/shared/_modal.scss index d95902d895..1ac3bbcbb2 100644 --- a/lms/static/sass/shared/_modal.scss +++ b/lms/static/sass/shared/_modal.scss @@ -115,10 +115,7 @@ padding: 12px; } -<<<<<<< HEAD - .activation-message, .message { -======= - .notice { + .activation-message, .message, .notice { background: $yellow; border: 1px solid darken($yellow, 60%); color: darken($yellow, 60%); @@ -128,7 +125,6 @@ } .activation-message { ->>>>>>> cb49d9c... Style notice. padding: 0 40px 10px; p {