'Renders the course\'s home page as a fragment.'

def render_to_fragment(self, request, course_id=None, **kwargs):

    course_key = CourseKey.from_string(course_id)
    course = get_course_with_access(request.user, 'load', course_key, check_if_enrolled=True)
    course_url_name = default_course_url_name(course.id)
    course_url = reverse(course_url_name, kwargs={'course_id': unicode(course.id)})
    ordered_updates = self.get_ordered_updates(request, course)
    plain_html_updates = ''
    if ordered_updates:
        plain_html_updates = self.get_plain_html_updates(request, course)
    context = {'csrf': csrf(request)['csrf_token'], 'course': course, 'course_url': course_url, 'updates': ordered_updates, 'plain_html_updates': plain_html_updates, 'disable_courseware_js': True, 'uses_pattern_library': True}
    html = render_to_string('course_experience/course-updates-fragment.html', context)
    return Fragment(html)
