def is_discussion_enabled(course_id): """ Return True if Discussion is enabled for a course; else False """ if settings.FEATURES.get('CUSTOM_COURSES_EDX', False): if get_current_ccx(course_id): return False return settings.FEATURES.get('ENABLE_DISCUSSION_SERVICE')
def render_body(context,online_help_token,**pageargs): __M_caller = context.caller_stack._push_frame() try: __M_locals = __M_dict_builtin(pageargs=pageargs,online_help_token=online_help_token) settings = context.get('settings', UNDEFINED) enable_enterprise_sidebar = context.get('enable_enterprise_sidebar', UNDEFINED) course = context.get('course', UNDEFINED) static = _mako_get_namespace(context, 'static') def navigation_logo(): return render_navigation_logo(context._locals(__M_locals)) is_secure = context.get('is_secure', UNDEFINED) __M_writer = context.writer() __M_writer(u'\n') __M_writer(u'\n\n') __M_writer(u'\n') __M_writer(u'\n\n<h1 class="header-logo">\n <a href="') __M_writer(filters.html_escape(filters.decode.utf8(branding_api.get_home_url()))) __M_writer(u'">\n ') if 'parent' not in context._data or not hasattr(context._data['parent'], 'navigation_logo'): context['self'].navigation_logo(**pageargs) __M_writer(u'\n </a>\n') if course: __M_writer(u' <div class="course-header">\n <span class="provider">') __M_writer(filters.html_escape(filters.decode.utf8(course.display_org_with_default))) __M_writer(u':</span>\n <span class="course-number">') __M_writer(filters.html_escape(filters.decode.utf8(course.display_number_with_default))) __M_writer(u'</span>\n ') display_name = course.display_name_with_default if settings.FEATURES.get('CUSTOM_COURSES_EDX', False): ccx = get_current_ccx(course.id) if ccx: display_name = ccx.display_name __M_locals_builtin_stored = __M_locals_builtin() __M_locals.update(__M_dict_builtin([(__M_key, __M_locals_builtin_stored[__M_key]) for __M_key in ['display_name','ccx'] if __M_key in __M_locals_builtin_stored])) __M_writer(u'\n <span class="course-name">') __M_writer(filters.html_escape(filters.decode.utf8(display_name))) __M_writer(u'</span>\n </div>\n') __M_writer(u'</h1>\n') if enable_enterprise_sidebar: __M_writer(u' <div class="enterprise-tagline">\n ') tagline = configuration_helpers.get_value('ENTERPRISE_TAGLINE', settings.ENTERPRISE_TAGLINE) __M_locals_builtin_stored = __M_locals_builtin() __M_locals.update(__M_dict_builtin([(__M_key, __M_locals_builtin_stored[__M_key]) for __M_key in ['tagline'] if __M_key in __M_locals_builtin_stored])) __M_writer(u'\n') if tagline: __M_writer(u' ') __M_writer(filters.html_escape(filters.decode.utf8(tagline))) __M_writer(u'\n') __M_writer(u' </div>\n') return '' finally: context.caller_stack._pop_frame()