MIT: CCX. Implement display of CCXs in user-facing templates such as dashboard

Show the display name for the POC in the menu for switching.

Remove the MOOC: prefix from the MOOC title to avoid truncation issues.

Incorporate the display name of the POC into the display of course org/number/name at the top of the page in the default theme.

Provide warning on the grading policy page in system warning style.

Provide a PocMembership model api that returns PocMemberships for a user.  Default to active memberships.

Build generator that yields triplets of poc, membership and course for each poc membership a user has.

This is an analog of the `get_course_enrollment_pairs` in common/djangoapps/students/views.py and is used in the student dashboard to provide pocs as options for a student to view.

refactor to use model api instead of inline code.

provide pocs as possible targets for a student to visit from their dashboard.

Unset the current active poc when visiting the dashboard so as to avoid needing to switch active pocs when viewing a plain course.  This ensures we can leave template code for the display of courses unchanged.

Update templates to show pocs in a course-like view on a student's dashboard.

Revert a portion of the template change so that the poc title will still render properly when a poc is being viewed.
This commit is contained in:
cewing
2015-01-06 12:26:26 -08:00
parent bb7eed58db
commit 0b184881f5
7 changed files with 161 additions and 23 deletions

View File

@@ -660,6 +660,17 @@ def dashboard(request):
if course.pre_requisite_courses)
courses_requirements_not_met = get_pre_requisite_courses_not_completed(user, courses_having_prerequisites)
poc_membership_triplets = []
if settings.FEATURES.get('PERSONAL_ONLINE_COURSES', False):
from pocs import ACTIVE_POC_KEY
from pocs.utils import get_poc_membership_triplets
poc_membership_triplets = get_poc_membership_triplets(
user, course_org_filter, org_filter_out_set
)
# should we deselect any active POC at this time so that we don't have
# to change the URL for viewing a course? I think so.
request.session[ACTIVE_POC_KEY] = None
context = {
'enrollment_message': enrollment_message,
'course_enrollment_pairs': course_enrollment_pairs,
@@ -691,6 +702,7 @@ def dashboard(request):
'provider_states': [],
'order_history_list': order_history_list,
'courses_requirements_not_met': courses_requirements_not_met,
'poc_membership_triplets': poc_membership_triplets,
}
if third_party_auth.is_enabled():