diff --git a/common/lib/xmodule/xmodule/course_module.py b/common/lib/xmodule/xmodule/course_module.py index 8435cfca9e..5f74873465 100644 --- a/common/lib/xmodule/xmodule/course_module.py +++ b/common/lib/xmodule/xmodule/course_module.py @@ -24,7 +24,11 @@ class CourseDescriptor(SequenceDescriptor): @property def title(self): - self.metadata['display_name'] + return self.metadata['display_name'] + + @property + def number(self): + return self.location.course @property def instructors(self): @@ -38,6 +42,7 @@ class CourseDescriptor(SequenceDescriptor): """ This returns the snippet of html to be rendered on the course about page, given the key for the section. Valid keys: + - overview - title - university - number @@ -59,10 +64,10 @@ class CourseDescriptor(SequenceDescriptor): # TODO: Remove number, instructors from this list if section_key in ['short_description', 'description', 'key_dates', 'video', 'course_staff_short', 'course_staff_extended', - 'requirements', 'syllabus', 'textbook', 'faq', 'more_info', 'number', 'instructors']: + 'requirements', 'syllabus', 'textbook', 'faq', 'more_info', 'number', 'instructors', 'overview']: try: with self.system.resources_fs.open(path("about") / section_key + ".html") as htmlFile: - return htmlFile.read() + 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 !" @@ -91,7 +96,7 @@ class CourseDescriptor(SequenceDescriptor): if section_key in ['handouts', 'guest_handouts', 'updates', 'guest_updates']: try: with self.system.resources_fs.open(path("info") / section_key + ".html") as htmlFile: - return htmlFile.read() + return htmlFile.read().decode('utf-8') except ResourceNotFoundError: log.exception("Missing info section {key} in course {url}".format(key=section_key, url=self.location.url())) return "! Info section missing !" diff --git a/doc/development.md b/doc/development.md new file mode 100644 index 0000000000..5b8e6fd837 --- /dev/null +++ b/doc/development.md @@ -0,0 +1,30 @@ +# Running the CMS + +One can start the CMS by running `rake cms`. This will run the server on localhost +port 8001. + +However, the server also needs data to work from. + +## Installing Mongodb + +Please see http://www.mongodb.org/downloads for more detailed instructions. + +### Ubuntu + + sudo apt-get install mongodb + +### OSX + +Use the MacPorts package `mongodb` or the Homebrew formula `mongodb` + +## Initializing Mongodb + +Check out the course data directories that you want to work with into the +`GITHUB_REPO_ROOT` (by default, `../data`). Then run the following command: + + + rake django-admin[import,cms,dev,../data] + +Replace `../data` with your `GITHUB_REPO_ROOT` if it's not the default value. + +This will import all courses in your data directory into mongodb diff --git a/lms/templates/course.html b/lms/templates/course.html index bcfcab2526..ab6067c6ea 100644 --- a/lms/templates/course.html +++ b/lms/templates/course.html @@ -9,7 +9,7 @@
-

${course.get_about_section('title')}

+

${course.number} ${course.get_about_section('title')}

@@ -19,35 +19,7 @@
-

An advanced introduction to analog circuits. An advanced introduction to analog circuits.

-
-
- ${course.get_about_section('university')} - 7/23/12 -
- - -
-

${course.get_about_section('university')}

-
- - -
-
-
- -
-

${course.get_about_section('title')}

-
- -
-
-
-
- -
-
-

An advanced introduction to analog circuits. An advanced introduction to analog circuits.

+ ${course.get_about_section('short_description')}
${course.get_about_section('university')} diff --git a/lms/templates/portal/course_about.html b/lms/templates/portal/course_about.html index 9b1b616e46..112333694f 100644 --- a/lms/templates/portal/course_about.html +++ b/lms/templates/portal/course_about.html @@ -11,7 +11,7 @@
-

${course.get_about_section("title")}

${course.get_about_section("university")}

+

${course.number}: ${course.get_about_section("title")}

${course.get_about_section("university")}

@@ -32,66 +32,15 @@
-
-

About this course

-

${course.get_about_section("description")}

-
- -
-

Course staff

-
-
- -
-

Anant Agarwal

-

Director of MIT’s Computer Science and Artificial Intelligence Laboratory (CSAIL) and a professor of the Electrical Engineering and Computer Science department at MIT. His research focus is in parallel computer architectures and cloud software systems, and he is a founder of several successful startups, including Tilera, a company that produces scalable multicore processors. Prof. Agarwal won MIT’s Smullin and Jamieson prizes for teaching and co-authored the course textbook “Foundations of Analog and Digital Electronic Circuits.”

-
- -
-
- -
-

Gerald Sussman

-

Professor of Electrical Engineering at MIT. He is a well known educator in the computer science community, perhaps best known as the author of Structure and Interpretation of Computer Programs, which is universally acknowledged as one of the top ten textbooks in computer science, and as the creator of Scheme, a popular teaching language. His research spans a range of topics, from artificial intelligence, to physics and chaotic systems, to supercomputer design.

-
- -
-
- -
-

Piotr Mitros

-

Research Scientist at MIT. His research focus is in finding ways to apply techniques from control systems to optimizing the learning process. Dr. Mitros has worked as an analog designer at Texas Instruments, Talking Lights, and most recently, designed the analog front end for a novel medical imaging modality for Rhythmia Medical.

-
-
- -
-

Requirements

-

${course.get_about_section("requirements")}

-
- -
-

Syllabus

-

${course.get_about_section("syllabus")}

-
- -
-

Textbook

- ${course.get_about_section("textbook")} -
- -
-

Frequently Asked Questions

-

${course.get_about_section("faq")}

-
- + ${course.get_about_section("overview")}
@@ -114,9 +63,9 @@
  1. Classes Start

    7/12/12
  2. -
  3. Final Exam

    12/09/12
  4. -
  5. Course Length

    15 weeks
  6. -
  7. Course Number

    ${course.get_about_section("number")}
  8. + ##
  9. Final Exam

    12/09/12
  10. + ##
  11. Course Length

    15 weeks
  12. +
  13. Course Number

    ${course.number}
diff --git a/lms/urls.py b/lms/urls.py index 3b63424ad2..26d9c0df35 100644 --- a/lms/urls.py +++ b/lms/urls.py @@ -127,7 +127,7 @@ if settings.COURSEWARE_ENABLED: # TODO (vshnayder): there is no student.views.course_info. # Where should this point instead? same as the info view? - url(r'^courses/(?P[^/]+/[^/]+/[^/]+)/about$', + url(r'^courses/(?P[^/]+/[^/]+/[^/]+)$', 'student.views.course_info', name="about_course"), )