Commit c47cdc7f by Matthew Mongeau

Fix some path problems.

parent 3053caec
...@@ -18,6 +18,10 @@ class CourseDescriptor(SequenceDescriptor): ...@@ -18,6 +18,10 @@ class CourseDescriptor(SequenceDescriptor):
def title(self): def title(self):
self.metadata['display_name'] self.metadata['display_name']
@property
def instructors(self):
return self.get_about_section("instructors").split("\n")
def get_about_section(self, section_key): def get_about_section(self, section_key):
""" """
This returns the snippet of html to be rendered on the course about page, given the key for the section. This returns the snippet of html to be rendered on the course about page, given the key for the section.
...@@ -41,8 +45,9 @@ class CourseDescriptor(SequenceDescriptor): ...@@ -41,8 +45,9 @@ class CourseDescriptor(SequenceDescriptor):
# Many of these are stored as html files instead of some semantic markup. This can change without effecting # Many of these are stored as html files instead of some semantic markup. This can change without effecting
# this interface when we find a good format for defining so many snippets of text/html. # this interface when we find a good format for defining so many snippets of text/html.
# TODO: Remove number, instructors from this list
if section_key in ['short_description', 'description', 'key_dates', 'video', 'course_staff_short', 'course_staff_extended', if section_key in ['short_description', 'description', 'key_dates', 'video', 'course_staff_short', 'course_staff_extended',
'requirements', 'syllabus', 'textbook', 'faq', 'more_info', 'number']: 'requirements', 'syllabus', 'textbook', 'faq', 'more_info', 'number', 'instructors']:
try: try:
with self.system.resources_fs.open(path("about") / section_key + ".html") as htmlFile: with self.system.resources_fs.open(path("about") / section_key + ".html") as htmlFile:
return htmlFile.read() return htmlFile.read()
......
...@@ -257,4 +257,4 @@ def course_info(request, course_id): ...@@ -257,4 +257,4 @@ def course_info(request, course_id):
except KeyError: except KeyError:
raise Http404("Course not found") raise Http404("Course not found")
return render_to_response('portal/course_about.html', {'csrf': csrf_token, 'course': course}) return render_to_response('info.html', {'csrf': csrf_token, 'course': course})
...@@ -48,9 +48,9 @@ ...@@ -48,9 +48,9 @@
</div> </div>
<section class="info"> <section class="info">
<hgroup> <hgroup>
<h2>${course.title}</h2> <h2>${course.get_about_section("title")}</h2>
% for instructor in course.instructors: % for instructor in course.instructors:
<h3>${course.institution}</h3> <h3>${course.get_about_section('university')}</h3>
% endfor % endfor
</hgroup> </hgroup>
<div class="edit">options</div> <div class="edit">options</div>
......
...@@ -77,7 +77,7 @@ if settings.COURSEWARE_ENABLED: ...@@ -77,7 +77,7 @@ if settings.COURSEWARE_ENABLED:
url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/profile$', 'courseware.views.profile', name="profile"), url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/profile$', 'courseware.views.profile', name="profile"),
url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/profile/(?P<student_id>[^/]*)/$', 'courseware.views.profile'), url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/profile/(?P<student_id>[^/]*)/$', 'courseware.views.profile'),
url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/about$', 'courseware.views.course_info', name="about_course"), url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/about$', 'student.views.course_info', name="about_course"),
) )
if settings.ENABLE_MULTICOURSE: if settings.ENABLE_MULTICOURSE:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment