Merge remote-tracking branch 'origin/dormsbee/at_a_glance' into release/1.0
This commit is contained in:
@@ -85,7 +85,8 @@ 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', 'overview']:
|
||||
'requirements', 'syllabus', 'textbook', 'faq', 'more_info', 'number', 'instructors', 'overview',
|
||||
'effort', 'end_date', 'prerequisites']:
|
||||
try:
|
||||
with self.system.resources_fs.open(path("about") / section_key + ".html") as htmlFile:
|
||||
return htmlFile.read().decode('utf-8')
|
||||
|
||||
@@ -250,12 +250,17 @@ def course_info(request, course_id):
|
||||
course = check_course(course_id)
|
||||
|
||||
return render_to_response('info.html', {'course': course})
|
||||
|
||||
|
||||
@ensure_csrf_cookie
|
||||
def course_about(request, course_id):
|
||||
def registered_for_course(course, user):
|
||||
if user.is_authenticated():
|
||||
return CourseEnrollment.objects.filter(user = user, course_id=course.id).exists()
|
||||
else:
|
||||
return False
|
||||
course = check_course(course_id, course_must_be_open=False)
|
||||
|
||||
return render_to_response('portal/course_about.html', {'course': course})
|
||||
registered = registered_for_course(course, request.user)
|
||||
return render_to_response('portal/course_about.html', {'course': course, 'registered': registered})
|
||||
|
||||
|
||||
@login_required
|
||||
|
||||
@@ -97,6 +97,20 @@
|
||||
color: rgb(255,255,255);
|
||||
}
|
||||
}
|
||||
|
||||
span.register {
|
||||
@include button(shiny, lighten(grayscale($blue), 50%));
|
||||
@include box-sizing(border-box);
|
||||
@include border-radius(3px);
|
||||
color: #888;
|
||||
display: block;
|
||||
font: normal 1.2rem/1.6rem $sans-serif;
|
||||
letter-spacing: 1px;
|
||||
padding: 10px 0px;
|
||||
text-transform: uppercase;
|
||||
text-align: center;
|
||||
width: flex-grid(12);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,11 @@
|
||||
|
||||
<div class="main-cta">
|
||||
%if user.is_authenticated():
|
||||
<a href="${reverse('enroll', args=[course.id])}" class="register">Register</a>
|
||||
%if registered:
|
||||
<span class="register disabled">Registered</span>
|
||||
%else:
|
||||
<a href="${reverse('enroll', args=[course.id])}" class="register">Register</a>
|
||||
%endif
|
||||
%else:
|
||||
<a href="#signup-modal" class="register" rel="leanModal" data-notice="You must register in order to enroll">Register</a>
|
||||
%endif
|
||||
@@ -71,10 +75,23 @@
|
||||
</header>
|
||||
|
||||
<ol class="important-dates">
|
||||
<li><div class="icon start-icon"></div><p>Classes Start</p><span class="start-date">${course.start_date_text}</span></li>
|
||||
##<li><div class="icon final-icon"></div><p>Final Exam</p><span class="final-date">12/09/12</span></li>
|
||||
##<li><div class="icon length-icon"></div><p>Course Length</p><span class="course-length">15 weeks</span></li>
|
||||
<li><div class="icon number-icon"></div><p>Course Number</p><span class="course-number">${course.number}</span></li>
|
||||
<li><div class="icon start-icon"></div><p>Classes Start</p><span class="start-date">${course.start_date_text}</span></li>
|
||||
|
||||
## End date should come from course.xml, but this is a quick hack
|
||||
% if course.get_about_section("end_date"):
|
||||
<li><div class="icon final-icon"></div><p>Classes End</p><span class="final-date">${course.get_about_section("end_date")}</span></li>
|
||||
% endif
|
||||
|
||||
% if course.get_about_section("effort"):
|
||||
<li><div class="icon"></div><p>Estimated Effort</p><span class="start-date">${course.get_about_section("effort")}</span></li>
|
||||
% endif
|
||||
|
||||
% if course.get_about_section("prerequisites"):
|
||||
<li><div class="icon"></div><p>Prerequisites</p><span class="start-date">${course.get_about_section("prerequisites")}</span></li>
|
||||
% endif
|
||||
|
||||
##<li><div class="icon length-icon"></div><p>Course Length</p><span class="course-length">15 weeks</span></li>
|
||||
</ol>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
Reference in New Issue
Block a user