예제 #1
0
def _mako_generate_namespaces(context):
    # SOURCE LINE 6
    ns = runtime.Namespace(u'elements',
                           context._clean_inheritance_tokens(),
                           templateuri=u'/component/elements.html',
                           callables=None,
                           calling_uri=_template_uri,
                           module=None)
    context.namespaces[(__name__, u'elements')] = ns
def render_body(context, **pageargs):
    __M_caller = context.caller_stack._push_frame()
    try:
        __M_locals = __M_dict_builtin(pageargs=pageargs)
        course = context.get('course', UNDEFINED)
        static = _mako_get_namespace(context, 'static')
        platform_key = context.get('platform_key', UNDEFINED)
        __M_writer = context.writer()
        __M_writer(u'\n')
        __M_writer(u'\n\n')
        __M_writer(u'\n\n')
        __M_writer(u'\n\n')
        if SHOW_REVIEWS_TOOL_FLAG.is_enabled(course.id):
            __M_writer(
                u'    <div class="coursetalk-read-reviews">\n        <span class="fa fa-spinner fa-spin" aria-hidden="true"></span>\n'
            )
            __M_writer(
                u'        <div id="ct-custom-read-review-widget" data-provider="'
            )
            __M_writer(filters.html_escape(filters.decode.utf8(platform_key)))
            __M_writer(u'" data-course="')
            __M_writer(filters.html_escape(filters.decode.utf8(course.id)))
            __M_writer(u'"></div>\n    </div>\n')
        __M_writer(u'\n')

        def ccall(caller):
            def body():
                __M_writer = context.writer()
                __M_writer(
                    u'\n    new CourseTalkReviews({\n        toggleButton: \'.toggle-read-write-reviews\',\n        loadIcon: \'.coursetalk-read-reviews .fa.fa-spinner\',\n        readSrc: "'
                )
                __M_writer(
                    js_escaped_string(settings.COURSE_TALK_READ_ONLY_SOURCE))
                __M_writer(u'",\n        writeSrc: "')
                __M_writer(
                    js_escaped_string(settings.COURSE_TALK_WRITE_ONLY_SOURCE))
                __M_writer(u'"\n    });\n')
                return ''

            return [body]

        context.caller_stack.nextcaller = runtime.Namespace(
            'caller', context, callables=ccall(__M_caller))
        try:
            __M_writer(
                filters.html_escape(
                    filters.decode.utf8(
                        static.webpack(entry=u'CourseTalkReviews'))))
        finally:
            context.caller_stack.nextcaller = None
        __M_writer(u'\n')
        return ''
    finally:
        context.caller_stack._pop_frame()
예제 #3
0
def render_body(context, **pageargs):
    __M_caller = context.caller_stack._push_frame()
    try:
        __M_locals = __M_dict_builtin(pageargs=pageargs)
        upgrade_url = context.get('upgrade_url', UNDEFINED)
        settings = context.get('settings', UNDEFINED)

        def content():
            return render_content(context._locals(__M_locals))

        course_id = context.get('course_id', UNDEFINED)
        static = _mako_get_namespace(context, 'static')
        show_course_sock = context.get('show_course_sock', UNDEFINED)
        course_price = context.get('course_price', UNDEFINED)
        __M_writer = context.writer()
        __M_writer(u'\n')
        __M_writer(u'\n')
        __M_writer(u'\n\n')
        __M_writer(u'\n\n')
        if 'parent' not in context._data or not hasattr(
                context._data['parent'], 'content'):
            context['self'].content(**pageargs)

        __M_writer(u'\n\n')

        def ccall(caller):
            def body():
                __M_writer = context.writer()
                __M_writer(
                    u"\n    new CourseSock({\n        el:'.verification-sock'\n    });\n"
                )
                return ''

            return [body]

        context.caller_stack.nextcaller = runtime.Namespace(
            'caller', context, callables=ccall(__M_caller))
        try:
            __M_writer(
                filters.html_escape(
                    filters.decode.utf8(static.webpack(entry=u'CourseSock'))))
        finally:
            context.caller_stack.nextcaller = None
        __M_writer(u'\n')
        return ''
    finally:
        context.caller_stack._pop_frame()
예제 #4
0
def render_content_center(context, **pageargs):
    __M_caller = context.caller_stack._push_frame()
    try:
        fl = _mako_get_namespace(context, 'fl')

        def content_center():
            return render_content_center(context)

        totalPrice = context.get('totalPrice', UNDEFINED)
        __M_writer = context.writer()
        __M_writer('\r\n    <h3>Total Price: $')
        __M_writer(str(totalPrice))
        __M_writer('</h3>\r\n\r\n   ')
        __M_writer('\r\n    ')

        def ccall(caller):
            def body():
                settings = context.get('settings', UNDEFINED)
                cart = context.get('cart', UNDEFINED)
                int = context.get('int', UNDEFINED)
                __M_writer = context.writer()
                __M_writer(
                    '\r\n  <div class="text-center">\r\n    <script\r\n        src="https://checkout.stripe.com/checkout.js"\r\n        class="stripe-button"\r\n        data-key="'
                )
                __M_writer(str(settings.STRIPE_PUBLIC_KEY))
                __M_writer('"\r\n        data-amount="')
                __M_writer(str(int(cart.total_price * 100)))
                __M_writer(
                    '"\r\n        data-description="Please Enter Your Payment Information"\r\n        data-image="https://stripe.com/img/documentation/checkout/marketplace.png"\r\n        data-local="auto"\r\n        data-label="Pay Now">\r\n    </script>\r\n\r\n  </div>\r\n'
                )
                return ''

            return [body]

        context.caller_stack.nextcaller = runtime.Namespace(
            'caller', context, callables=ccall(__M_caller))
        try:
            __M_writer(str(fl.render()))
        finally:
            context.caller_stack.nextcaller = None
        __M_writer('\r\n')
        return ''
    finally:
        context.caller_stack._pop_frame()
예제 #5
0
def render_js_extra(context, **pageargs):
    __M_caller = context.caller_stack._push_frame()
    try:

        def js_extra():
            return render_js_extra(context)

        static = _mako_get_namespace(context, 'static')
        __M_writer = context.writer()
        __M_writer(u'\n')

        def ccall(caller):
            def body():
                data = context.get('data', UNDEFINED)
                __M_writer = context.writer()
                __M_writer(u'\n    var options = ')
                __M_writer(dump_js_escaped_json(data))
                __M_writer(u';\n    LearnerProfileFactory(options);\n')
                return ''

            return [body]

        context.caller_stack.nextcaller = runtime.Namespace(
            'caller', context, callables=ccall(__M_caller))
        try:
            __M_writer(
                filters.html_escape(
                    filters.decode.utf8(
                        static.require_module(
                            class_name=u'LearnerProfileFactory',
                            module_name=
                            u'learner_profile/js/learner_profile_factory'))))
        finally:
            context.caller_stack.nextcaller = None
        __M_writer(u'\n')
        return ''
    finally:
        context.caller_stack._pop_frame()
예제 #6
0
def render_js_extra(context, **pageargs):
    __M_caller = context.caller_stack._push_frame()
    try:
        _import_ns = {}
        _mako_get_namespace(context, '__anon_0x7f4938752a50')._populate(
            _import_ns, [u'login_query'])

        def js_extra():
            return render_js_extra(context)

        static = _mako_get_namespace(context, 'static')
        __M_writer = context.writer()
        __M_writer(u'\n    ')

        def ccall(caller):
            def body():
                __M_writer = context.writer()
                __M_writer(u'\n    HeaderFactory();\n    ')
                return ''

            return [body]

        context.caller_stack.nextcaller = runtime.Namespace(
            'caller', context, callables=ccall(__M_caller))
        try:
            __M_writer(
                filters.html_escape(
                    filters.decode.utf8(
                        static.require_module(
                            class_name=u'HeaderFactory',
                            module_name=u'js/header_factory'))))
        finally:
            context.caller_stack.nextcaller = None
        __M_writer(u'\n    ')
        return ''
    finally:
        context.caller_stack._pop_frame()
예제 #7
0
def render_header_extras(context, **pageargs):
    __M_caller = context.caller_stack._push_frame()
    try:

        def header_extras():
            return render_header_extras(context)

        static = _mako_get_namespace(context, 'static')
        __M_writer = context.writer()
        __M_writer(u'\n')
        for template_name in ["donation"]:
            __M_writer(u'<script type="text/template" id="')
            __M_writer(filters.html_escape(filters.decode.utf8(template_name)))
            __M_writer(u'-tpl">\n  ')

            def ccall(caller):
                def body():
                    __M_writer = context.writer()
                    return ''

                return [body]

            context.caller_stack.nextcaller = runtime.Namespace(
                'caller', context, callables=ccall(__M_caller))
            try:
                __M_writer(
                    filters.html_escape(
                        filters.decode.utf8(
                            static.include(path=u'dashboard/' +
                                           (template_name) + u'.underscore'))))
            finally:
                context.caller_stack.nextcaller = None
            __M_writer(u'\n</script>\n')
        return ''
    finally:
        context.caller_stack._pop_frame()
예제 #8
0
def render_js_extra(context,**pageargs):
    __M_caller = context.caller_stack._push_frame()
    try:
        fragment = context.get('fragment', UNDEFINED)
        request = context.get('request', UNDEFINED)
        course = context.get('course', UNDEFINED)
        def js_extra():
            return render_js_extra(context)
        static = _mako_get_namespace(context, 'static')
        staff_access = context.get('staff_access', UNDEFINED)
        __M_writer = context.writer()
        __M_writer(u'\n<script type="text/javascript" src="')
        __M_writer(filters.html_escape(filters.decode.utf8(static.url('common/js/vendor/jquery.scrollTo.js'))))
        __M_writer(u'"></script>\n<script type="text/javascript" src="')
        __M_writer(filters.html_escape(filters.decode.utf8(static.url('js/vendor/flot/jquery.flot.js'))))
        __M_writer(u'"></script>\n\n')
        def ccall(caller):
            def body():
                __M_writer = context.writer()
                return ''
            return [body]
        context.caller_stack.nextcaller = runtime.Namespace('caller', context, callables=ccall(__M_caller))
        try:
            __M_writer(filters.html_escape(filters.decode.utf8(static.js(group=u'courseware'))))
        finally:
            context.caller_stack.nextcaller = None
        __M_writer(u'\n')
        runtime._include_file(context, u'/mathjax_include.html', _template_uri, disable_fast_preview=True)
        __M_writer(u'\n\n')
        if settings.FEATURES.get('ENABLE_COURSEWARE_SEARCH'):
            def ccall(caller):
                def body():
                    __M_writer = context.writer()
                    __M_writer(u"\nvar courseId = $('.courseware-results').data('courseId');\nCourseSearchFactory({\ncourseId: courseId,\nsearchHeader: $('.search-bar')\n});\n")
                    return ''
                return [body]
            context.caller_stack.nextcaller = runtime.Namespace('caller', context, callables=ccall(__M_caller))
            try:
                __M_writer(filters.html_escape(filters.decode.utf8(static.require_module(class_name=u'CourseSearchFactory',module_name=u'course_search/js/course_search_factory'))))
            finally:
                context.caller_stack.nextcaller = None
            __M_writer(u'\n')
        __M_writer(u'\n')
        def ccall(caller):
            def body():
                __M_writer = context.writer()
                __M_writer(u'\nCoursewareFactory();\n')
                return ''
            return [body]
        context.caller_stack.nextcaller = runtime.Namespace('caller', context, callables=ccall(__M_caller))
        try:
            __M_writer(filters.html_escape(filters.decode.utf8(static.require_module(class_name=u'CoursewareFactory',module_name=u'js/courseware/courseware_factory'))))
        finally:
            context.caller_stack.nextcaller = None
        __M_writer(u'\n\n')
        if staff_access:
            runtime._include_file(context, u'xqa_interface.html', _template_uri)
            __M_writer(u'\n')
        __M_writer(u'\n<script type="text/javascript">\n    var $$course_id = "')
        __M_writer(js_escaped_string(course.id ))
        __M_writer(u'";\n</script>\n\n')
        if not request.user.is_authenticated:
            __M_writer(u'<script type="text/javascript">\n    // Disable discussions\n    $(\'.xblock-student_view-discussion button.discussion-show\').attr(\'disabled\', true);\n\n    // Insert message informing user discussions are only available to logged in users.\n    $(\'.discussion-module\')\n</script>\n')
        __M_writer(u'\n')
        __M_writer(filters.html_escape(filters.decode.utf8(HTML(fragment.foot_html()))))
        __M_writer(u'\n\n')
        return ''
    finally:
        context.caller_stack._pop_frame()
예제 #9
0
def render_body(context, **pageargs):
    __M_caller = context.caller_stack._push_frame()
    try:
        __M_locals = __M_dict_builtin(pageargs=pageargs)
        static = _mako_get_namespace(context, 'static')
        image_src = context.get('image_src', UNDEFINED)
        course_home_messages = context.get('course_home_messages', UNDEFINED)
        __M_writer = context.writer()
        __M_writer(u'\n')
        __M_writer(u'\n')
        __M_writer(u'\n\n')
        __M_writer(u'\n\n')

        is_rtl = get_language_bidi()

        __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 ['is_rtl']
                              if __M_key in __M_locals_builtin_stored]))
        __M_writer(u'\n\n')
        if course_home_messages:
            for message in course_home_messages:
                __M_writer(u'        <div class="course-message">\n')
                if not is_rtl:
                    __M_writer(
                        u'                <img class="message-author" alt="" src="'
                    )
                    __M_writer(
                        filters.html_escape(
                            filters.decode.utf8(static.url(image_src))))
                    __M_writer(u'"/>\n')
                __M_writer(
                    u'            <div class="message-content" aria-live="polite">\n                '
                )
                __M_writer(
                    filters.html_escape(
                        filters.decode.utf8(HTML(message.message_html))))
                __M_writer(u'\n            </div>\n')
                if is_rtl:
                    __M_writer(
                        u'                <img class="message-author" alt="" src="'
                    )
                    __M_writer(
                        filters.html_escape(
                            filters.decode.utf8(static.url(image_src))))
                    __M_writer(u'"/>\n')
                __M_writer(u'        </div>\n')
        __M_writer(u'\n')

        def ccall(caller):
            def body():
                course_id = context.get('course_id', UNDEFINED)
                username = context.get('username', UNDEFINED)
                goal_api_url = context.get('goal_api_url', UNDEFINED)
                __M_writer = context.writer()
                __M_writer(u'\n    new CourseGoals({\n        goalApiUrl: "')
                __M_writer(js_escaped_string(goal_api_url))
                __M_writer(u'",\n        courseId: "')
                __M_writer(js_escaped_string(course_id))
                __M_writer(u'",\n        username: "******",\n    });\n')
                return ''

            return [body]

        context.caller_stack.nextcaller = runtime.Namespace(
            'caller', context, callables=ccall(__M_caller))
        try:
            __M_writer(
                filters.html_escape(
                    filters.decode.utf8(static.webpack(entry=u'CourseGoals'))))
        finally:
            context.caller_stack.nextcaller = None
        __M_writer(u'\n')
        return ''
    finally:
        context.caller_stack._pop_frame()
예제 #10
0
def render_js_extra(context, **pageargs):
    __M_caller = context.caller_stack._push_frame()
    try:

        def js_extra():
            return render_js_extra(context)

        static = _mako_get_namespace(context, 'static')
        user = context.get('user', UNDEFINED)
        auth = context.get('auth', UNDEFINED)
        __M_writer = context.writer()
        __M_writer(u'\n')

        def ccall(caller):
            def body():
                password_reset_support_link = context.get(
                    'password_reset_support_link', UNDEFINED)
                extended_profile_fields = context.get(
                    'extended_profile_fields', UNDEFINED)
                enterprise_name = context.get('enterprise_name', UNDEFINED)
                user_preferences_api_url = context.get(
                    'user_preferences_api_url', UNDEFINED)
                fields = context.get('fields', UNDEFINED)
                enterprise_readonly_account_fields = context.get(
                    'enterprise_readonly_account_fields', UNDEFINED)
                sync_learner_profile_data = context.get(
                    'sync_learner_profile_data', UNDEFINED)
                edx_support_url = context.get('edx_support_url', UNDEFINED)
                bool = context.get('bool', UNDEFINED)
                user_accounts_api_url = context.get('user_accounts_api_url',
                                                    UNDEFINED)
                enable_account_deletion = context.get(
                    'enable_account_deletion', UNDEFINED)
                order_history = context.get('order_history', UNDEFINED)
                __M_writer = context.writer()
                __M_writer(u'\n    var fieldsData = ')
                __M_writer(dump_js_escaped_json(fields))
                __M_writer(u',\n        ordersHistoryData = ')
                __M_writer(dump_js_escaped_json(order_history))
                __M_writer(u',\n        authData = ')
                __M_writer(dump_js_escaped_json(auth))
                __M_writer(u",\n        platformName = '")
                __M_writer(js_escaped_string(static.get_platform_name()))
                __M_writer(u"',\n        contactEmail = '")
                __M_writer(
                    js_escaped_string(static.get_contact_email_address()))
                __M_writer(u"',\n        allowEmailChange = ")
                __M_writer(
                    dump_js_escaped_json(
                        bool(settings.FEATURES['ALLOW_EMAIL_ADDRESS_CHANGE'])))
                __M_writer(u',\n        socialPlatforms = ')
                __M_writer(dump_js_escaped_json(settings.SOCIAL_PLATFORMS))
                __M_writer(u',\n\n        syncLearnerProfileData = ')
                __M_writer(
                    dump_js_escaped_json(bool(sync_learner_profile_data)))
                __M_writer(u",\n        enterpriseName = '")
                __M_writer(js_escaped_string(enterprise_name))
                __M_writer(u"',\n        enterpriseReadonlyAccountFields = ")
                __M_writer(
                    dump_js_escaped_json(enterprise_readonly_account_fields))
                __M_writer(u",\n        edxSupportUrl = '")
                __M_writer(js_escaped_string(edx_support_url))
                __M_writer(u"',\n        extendedProfileFields = ")
                __M_writer(dump_js_escaped_json(extended_profile_fields))
                __M_writer(u',\n        displayAccountDeletion = ')
                __M_writer(dump_js_escaped_json(enable_account_deletion))
                __M_writer(u';\n        isSecondaryEmailFeatureEnabled = ')
                __M_writer(
                    dump_js_escaped_json(
                        bool(is_secondary_email_feature_enabled_for_user(
                            user))))
                __M_writer(
                    u",\n\n    AccountSettingsFactory(\n        fieldsData,\n        ordersHistoryData,\n        authData,\n        '"
                )
                __M_writer(js_escaped_string(password_reset_support_link))
                __M_writer(u"',\n        '")
                __M_writer(js_escaped_string(user_accounts_api_url))
                __M_writer(u"',\n        '")
                __M_writer(js_escaped_string(user_preferences_api_url))
                __M_writer(u"',\n        ")
                __M_writer(dump_js_escaped_json(user.id))
                __M_writer(
                    u',\n        platformName,\n        contactEmail,\n        allowEmailChange,\n        socialPlatforms,\n\n        syncLearnerProfileData,\n        enterpriseName,\n        enterpriseReadonlyAccountFields,\n        edxSupportUrl,\n        extendedProfileFields,\n        displayAccountDeletion,\n        isSecondaryEmailFeatureEnabled\n    );\n'
                )
                return ''

            return [body]

        context.caller_stack.nextcaller = runtime.Namespace(
            'caller', context, callables=ccall(__M_caller))
        try:
            __M_writer(
                filters.html_escape(
                    filters.decode.utf8(
                        static.require_module(
                            class_name=u'AccountSettingsFactory',
                            module_name=
                            u'js/student_account/views/account_settings_factory'
                        ))))
        finally:
            context.caller_stack.nextcaller = None
        __M_writer(u'\n\n<script type="text/javascript">\n     window.auth = ')
        __M_writer(dump_js_escaped_json(auth))
        __M_writer(u';\n     window.isActive = ')
        __M_writer(dump_js_escaped_json(user.is_active))
        __M_writer(u';\n</script>\n')

        def ccall(caller):
            def body():
                __M_writer = context.writer()
                __M_writer(u'\n')
                return ''

            return [body]

        context.caller_stack.nextcaller = runtime.Namespace(
            'caller', context, callables=ccall(__M_caller))
        try:
            __M_writer(
                filters.html_escape(
                    filters.decode.utf8(
                        static.webpack(
                            entry=u'StudentAccountDeletionInitializer'))))
        finally:
            context.caller_stack.nextcaller = None
        __M_writer(u'\n')
        return ''
    finally:
        context.caller_stack._pop_frame()
예제 #11
0
def render_js_extra(context, **pageargs):
    __M_caller = context.caller_stack._push_frame()
    try:
        redirect_message = context.get('redirect_message', UNDEFINED)

        def js_extra():
            return render_js_extra(context)

        static = _mako_get_namespace(context, 'static')
        settings = context.get('settings', UNDEFINED)
        __M_writer = context.writer()
        __M_writer(u'\n  <script src="')
        __M_writer(
            filters.html_escape(
                filters.decode.utf8(static.url('js/commerce/credit.js'))))
        __M_writer(u'"></script>\n  ')

        def ccall(caller):
            def body():
                __M_writer = context.writer()
                return ''

            return [body]

        context.caller_stack.nextcaller = runtime.Namespace(
            'caller', context, callables=ccall(__M_caller))
        try:
            __M_writer(
                filters.html_escape(
                    filters.decode.utf8(static.js(group=u'dashboard'))))
        finally:
            context.caller_stack.nextcaller = None
        __M_writer(
            u'\n  <script type="text/javascript">\n    $(document).ready(function() {\n      edx.dashboard.legacy.init({\n        dashboard: "'
        )
        __M_writer(js_escaped_string(reverse('dashboard')))
        __M_writer(u'",\n        signInUser: "******",\n        changeEmailSettings: "')
        __M_writer(js_escaped_string(reverse('change_email_settings')))
        __M_writer(u'"\n      });\n    });\n  </script>\n  ')

        def ccall(caller):
            def body():
                marketing_link = context.get('marketing_link', UNDEFINED)
                __M_writer = context.writer()
                __M_writer(
                    u'\n    UnenrollmentFactory({\n      urls: {\n        dashboard: "'
                )
                __M_writer(js_escaped_string(reverse('dashboard')))
                __M_writer(u'",\n        signInUser: "******",\n        changeEmailSettings: "')
                __M_writer(js_escaped_string(reverse('change_email_settings')))
                __M_writer(u'",\n        browseCourses: "')
                __M_writer(js_escaped_string(marketing_link('COURSES')))
                __M_writer(u'"\n      },\n      isEdx: false\n    });\n  ')
                return ''

            return [body]

        context.caller_stack.nextcaller = runtime.Namespace(
            'caller', context, callables=ccall(__M_caller))
        try:
            __M_writer(
                filters.html_escape(
                    filters.decode.utf8(
                        static.webpack(entry=u'UnenrollmentFactory'))))
        finally:
            context.caller_stack.nextcaller = None
        __M_writer(u'\n  ')

        def ccall(caller):
            def body():
                marketing_link = context.get('marketing_link', UNDEFINED)
                __M_writer = context.writer()
                __M_writer(u'\n')
                __M_writer(
                    u'    $(document).ready(function() {\n      EntitlementUnenrollmentFactory({\n        dashboardPath: "'
                )
                __M_writer(js_escaped_string(reverse('dashboard')))
                __M_writer(u'",\n        signInPath: "')
                __M_writer(js_escaped_string(reverse('signin_user')))
                __M_writer(u'",\n        browseCourses: "')
                __M_writer(js_escaped_string(marketing_link('COURSES')))
                __M_writer(u'",\n        isEdx: false\n      });\n    });\n  ')
                return ''

            return [body]

        context.caller_stack.nextcaller = runtime.Namespace(
            'caller', context, callables=ccall(__M_caller))
        try:
            __M_writer(
                filters.html_escape(
                    filters.decode.utf8(
                        static.webpack(
                            entry=u'EntitlementUnenrollmentFactory'))))
        finally:
            context.caller_stack.nextcaller = None
        __M_writer(u'\n')
        if settings.FEATURES.get('ENABLE_DASHBOARD_SEARCH'):
            __M_writer(u'    ')

            def ccall(caller):
                def body():
                    __M_writer = context.writer()
                    __M_writer(u'\n        DashboardSearchFactory();\n    ')
                    return ''

                return [body]

            context.caller_stack.nextcaller = runtime.Namespace(
                'caller', context, callables=ccall(__M_caller))
            try:
                __M_writer(
                    filters.html_escape(
                        filters.decode.utf8(
                            static.require_module(
                                class_name=u'DashboardSearchFactory',
                                module_name=
                                u'course_search/js/dashboard_search_factory')))
                )
            finally:
                context.caller_stack.nextcaller = None
            __M_writer(u'\n')
        if redirect_message:
            __M_writer(u'    ')

            def ccall(caller):
                def body():
                    __M_writer = context.writer()
                    __M_writer(
                        u"\n        var banner = new MessageBannerView({urgency: 'low', type: 'warning'});\n        $('#content').prepend(banner.$el);\n        banner.showMessage("
                    )
                    __M_writer(dump_js_escaped_json(redirect_message))
                    __M_writer(u')\n    ')
                    return ''

                return [body]

            context.caller_stack.nextcaller = runtime.Namespace(
                'caller', context, callables=ccall(__M_caller))
            try:
                __M_writer(
                    filters.html_escape(
                        filters.decode.utf8(
                            static.require_module(
                                class_name=u'MessageBannerView',
                                module_name=u'js/views/message_banner'))))
            finally:
                context.caller_stack.nextcaller = None
            __M_writer(u'\n')
        return ''
    finally:
        context.caller_stack._pop_frame()
예제 #12
0
파일: footer.html.py 프로젝트: lxp20201/lxp
def render_body(context,**pageargs):
    __M_caller = context.caller_stack._push_frame()
    try:
        __M_locals = __M_dict_builtin(pageargs=pageargs)
        include_dependencies = context.get('include_dependencies', UNDEFINED)
        uses_bootstrap = context.get('uses_bootstrap', UNDEFINED)
        settings = context.get('settings', UNDEFINED)
        footer_css_urls = context.get('footer_css_urls', UNDEFINED)
        getattr = context.get('getattr', UNDEFINED)
        static = _mako_get_namespace(context, 'static')
        bidi = context.get('bidi', UNDEFINED)
        enumerate = context.get('enumerate', UNDEFINED)
        is_secure = context.get('is_secure', UNDEFINED)
        hide_openedx_link = context.get('hide_openedx_link', UNDEFINED)
        __M_writer = context.writer()
        __M_writer(u'\n')
        __M_writer(u'\n')
        footer = get_footer(is_secure=is_secure) 
        
        __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 ['footer'] if __M_key in __M_locals_builtin_stored]))
        __M_writer(u'\n')
        __M_writer(u'\n\n')
        if uses_bootstrap:
            __M_writer(u'  <div class="container-fluid wrapper-footer">\n    <footer>\n      <div class="row">\n        <div class="col-md-9">\n          <nav class="navbar site-nav navbar-expand-sm" aria-label="')
            __M_writer(filters.html_escape(filters.decode.utf8(_('About'))))
            __M_writer(u'">\n            <ul class="navbar-nav">\n')
            for item_num, link in enumerate(footer['navigation_links'], start=1):
                __M_writer(u'                <li class="nav-item">\n                  <a class="nav-link" href="')
                __M_writer(filters.html_escape(filters.decode.utf8(link['url'])))
                __M_writer(u'">')
                __M_writer(filters.html_escape(filters.decode.utf8(link['title'])))
                __M_writer(u'</a>\n                </li>\n')
            __M_writer(u'            </ul>\n          </nav>\n\n')
            __M_writer(u'          <p class="copyright">')
            __M_writer(filters.html_escape(filters.decode.utf8(footer['copyright'])))
            __M_writer(u' ')
            __M_writer(filters.html_escape(filters.decode.utf8(u" | {icp}".format(icp=getattr(settings,'ICP_LICENSE')) if getattr(settings,'ICP_LICENSE',False) else "")))
            __M_writer(u'</p>\n\n          <nav class="navbar legal-nav navbar-expand-sm" aria-label="')
            __M_writer(filters.html_escape(filters.decode.utf8(_('Legal'))))
            __M_writer(u'">\n            <ul class="navbar-nav">\n')
            for item_num, link in enumerate(footer['legal_links'], start=1):
                __M_writer(u'                <li class="nav-item">\n                  <a class="nav-link" href="')
                __M_writer(filters.html_escape(filters.decode.utf8(link['url'])))
                __M_writer(u'">')
                __M_writer(filters.html_escape(filters.decode.utf8(link['title'])))
                __M_writer(u'</a>\n                </li>\n')
            __M_writer(u'              <li class="nav-item">\n                <a class="nav-link" href="')
            __M_writer(filters.html_escape(filters.decode.utf8(footer['edx_org_link']['url'])))
            __M_writer(u'">')
            __M_writer(filters.html_escape(filters.decode.utf8(footer['edx_org_link']['text'])))
            __M_writer(u'</a>\n              </li>\n            </ul>\n          </nav>\n        </div>\n        <div class="col-md-3">\n')
            if not hide_openedx_link:
                __M_writer(u'            <div class="footer-about-openedx">\n              <p>\n                <a href="')
                __M_writer(filters.html_escape(filters.decode.utf8(footer['openedx_link']['url'])))
                __M_writer(u'">\n                  <img src="')
                __M_writer(filters.html_escape(filters.decode.utf8(footer['openedx_link']['image'])))
                __M_writer(u'" alt="')
                __M_writer(filters.html_escape(filters.decode.utf8(footer['openedx_link']['title'])))
                __M_writer(u'" width="140" />\n                </a>\n              </p>\n            </div>\n')
            __M_writer(u'        </div>\n      </div>\n    </footer>\n  </div>\n')
        else:
            __M_writer(u'  <div class="wrapper wrapper-footer">\n    <footer id="footer-openedx" class="grid-container"\n')
            if bidi:
                __M_writer(u'        dir=')
                __M_writer(filters.html_escape(filters.decode.utf8(bidi)))
                __M_writer(u'\n')
            __M_writer(u'    >\n      <div class="colophon">\n        <nav class="nav-colophon" aria-label="')
            __M_writer(filters.html_escape(filters.decode.utf8(_('About'))))
            __M_writer(u'">\n          <ol>\n')
            for item_num, link in enumerate(footer['navigation_links'], start=1):
                __M_writer(u'              <li class="nav-colophon-0')
                __M_writer(filters.html_escape(filters.decode.utf8(item_num)))
                __M_writer(u'">\n                <a id="')
                __M_writer(filters.html_escape(filters.decode.utf8(link['name'])))
                __M_writer(u'" href="')
                __M_writer(filters.html_escape(filters.decode.utf8(link['url'])))
                __M_writer(u'">')
                __M_writer(filters.html_escape(filters.decode.utf8(link['title'])))
                __M_writer(u'</a>\n              </li>\n')
            __M_writer(u'          </ol>\n        </nav>\n\n')
            if context.get('include_language_selector', footer_language_selector_is_enabled()):
                __M_writer(u'            ')
                runtime._include_file(context, (static.get_template_path('widgets/footer-language-selector.html')), _template_uri)
                __M_writer(u'\n')
            __M_writer(u'\n        <div class="wrapper-logo">\n          <p>\n            <a href="/">\n')
            __M_writer(u'              <img alt="organization logo" src="')
            __M_writer(filters.html_escape(filters.decode.utf8(footer['logo_image'])))
            __M_writer(u'">\n            </a>\n          </p>\n        </div>\n\n')
            __M_writer(u'        <p class="copyright">')
            __M_writer(filters.html_escape(filters.decode.utf8(footer['copyright'])))
            __M_writer(u' ')
            __M_writer(filters.html_escape(filters.decode.utf8(u" | {icp}".format(icp=getattr(settings,'ICP_LICENSE')) if getattr(settings,'ICP_LICENSE',False) else "")))
            __M_writer(u'</p>\n\n        <nav class="nav-legal" aria-label="')
            __M_writer(filters.html_escape(filters.decode.utf8(_('Legal'))))
            __M_writer(u'">\n          <ul>\n')
            for item_num, link in enumerate(footer['legal_links'], start=1):
                __M_writer(u'              <li class="nav-legal-0')
                __M_writer(filters.html_escape(filters.decode.utf8(item_num)))
                __M_writer(u'">\n                <a href="')
                __M_writer(filters.html_escape(filters.decode.utf8(link['url'])))
                __M_writer(u'">')
                __M_writer(filters.html_escape(filters.decode.utf8(link['title'])))
                __M_writer(u'</a>\n              </li>\n')
            __M_writer(u'            <li><a href="')
            __M_writer(filters.html_escape(filters.decode.utf8(footer['edx_org_link']['url'])))
            __M_writer(u'">')
            __M_writer(filters.html_escape(filters.decode.utf8(footer['edx_org_link']['text'])))
            __M_writer(u'</a></li>\n          </ul>\n        </nav>\n      </div>\n\n')
            if not hide_openedx_link:
                __M_writer(u'      <div class="footer-about-openedx">\n        <p>\n          <a href="')
                __M_writer(filters.html_escape(filters.decode.utf8(footer['openedx_link']['url'])))
                __M_writer(u'">\n            <img src="')
                __M_writer(filters.html_escape(filters.decode.utf8(footer['openedx_link']['image'])))
                __M_writer(u'" alt="')
                __M_writer(filters.html_escape(filters.decode.utf8(footer['openedx_link']['title'])))
                __M_writer(u'" width="140" />\n          </a>\n        </p>\n      </div>\n')
            __M_writer(u'    </footer>\n  </div>\n')
        if include_dependencies:
            __M_writer(u'  ')
            def ccall(caller):
                def body():
                    __M_writer = context.writer()
                    return ''
                return [body]
            context.caller_stack.nextcaller = runtime.Namespace('caller', context, callables=ccall(__M_caller))
            try:
                __M_writer(filters.html_escape(filters.decode.utf8(static.js(group=u'base_vendor'))))
            finally:
                context.caller_stack.nextcaller = None
            __M_writer(u'\n  ')
            def ccall(caller):
                def body():
                    __M_writer = context.writer()
                    return ''
                return [body]
            context.caller_stack.nextcaller = runtime.Namespace('caller', context, callables=ccall(__M_caller))
            try:
                __M_writer(filters.html_escape(filters.decode.utf8(static.css(group=u'style-vendor'))))
            finally:
                context.caller_stack.nextcaller = None
            __M_writer(u'\n  ')
            runtime._include_file(context, u'widgets/segment-io.html', _template_uri)
            __M_writer(u'\n  ')
            runtime._include_file(context, u'widgets/segment-io-footer.html', _template_uri)
            __M_writer(u'\n')
        if footer_css_urls:
            for url in footer_css_urls:
                __M_writer(u'    <link rel="stylesheet" type="text/css" href="')
                __M_writer(filters.html_escape(filters.decode.utf8(url)))
                __M_writer(u'"></link>\n')
        return ''
    finally:
        context.caller_stack._pop_frame()
예제 #13
0
파일: course.html.py 프로젝트: lxp20201/lxp
def render_body(context, course, **pageargs):
    __M_caller = context.caller_stack._push_frame()
    try:
        __M_locals = __M_dict_builtin(course=course, pageargs=pageargs)
        static = _mako_get_namespace(context, 'static')
        LANGUAGE_CODE = context.get('LANGUAGE_CODE', UNDEFINED)
        __M_writer = context.writer()
        __M_writer(u'\n')
        __M_writer(u'\n')
        __M_writer(u'\n')
        __M_writer(u'\n<article class="course" id="')
        __M_writer(filters.html_escape(filters.decode.utf8(course.id)))
        __M_writer(u'" role="region" aria-label="')
        __M_writer(
            filters.html_escape(
                filters.decode.utf8(course.display_name_with_default)))
        __M_writer(u'">\n  <a href="')
        __M_writer(
            filters.html_escape(
                filters.decode.utf8(
                    reverse('about_course', args=[text_type(course.id)]))))
        __M_writer(
            u'">\n    <header class="course-image">\n      <div class="cover-image">\n        <img src="'
        )
        __M_writer(
            filters.html_escape(filters.decode.utf8(course.course_image_url)))
        __M_writer(u'" alt="')
        __M_writer(
            filters.html_escape(
                filters.decode.utf8(course.display_name_with_default)))
        __M_writer(u' ')
        __M_writer(
            filters.html_escape(
                filters.decode.utf8(course.display_number_with_default)))
        __M_writer(
            u'" />\n        <div class="learn-more" aria-hidden="true">')
        __M_writer(filters.html_escape(filters.decode.utf8(_("LEARN MORE"))))
        __M_writer(
            u'</div>\n      </div>\n    </header>\n    <div class="course-info" aria-hidden="true">\n      <h2 class="course-name">\n        <span class="course-organization">'
        )
        __M_writer(
            filters.html_escape(
                filters.decode.utf8(course.display_org_with_default)))
        __M_writer(u'</span>\n        <span class="course-code">')
        __M_writer(
            filters.html_escape(
                filters.decode.utf8(course.display_number_with_default)))
        __M_writer(u'</span>\n        <span class="course-title">')
        __M_writer(
            filters.html_escape(
                filters.decode.utf8(course.display_name_with_default)))
        __M_writer(u'</span>\n      </h2>\n      ')

        if course.start is not None:
            course_date_string = course.start.strftime('%Y-%m-%dT%H:%M:%S%z')
        else:
            course_date_string = ''

        __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 ['course_date_string']
                              if __M_key in __M_locals_builtin_stored]))
        __M_writer(u'\n')
        if course.advertised_start is not None:
            __M_writer(
                u'          <div class="course-date" aria-hidden="true">')
            __M_writer(filters.html_escape(filters.decode.utf8(_("Starts"))))
            __M_writer(u': ')
            __M_writer(
                filters.html_escape(
                    filters.decode.utf8(course.advertised_start)))
            __M_writer(u'</div>\n')
        else:
            __M_writer(
                u'          <div class="course-date localized_datetime" aria-hidden="true" data-format="shortDate" data-datetime="'
            )
            __M_writer(
                filters.html_escape(filters.decode.utf8(course_date_string)))
            __M_writer(u'" data-language="')
            __M_writer(filters.html_escape(filters.decode.utf8(LANGUAGE_CODE)))
            __M_writer(u'" data-string="')
            __M_writer(
                filters.html_escape(filters.decode.utf8(_("Starts: {date}"))))
            __M_writer(u'"></div>\n')
        __M_writer(
            u'    </div>\n    <div class="sr">\n      <ul>\n        <li>')
        __M_writer(
            filters.html_escape(
                filters.decode.utf8(course.display_org_with_default)))
        __M_writer(u'</li>\n        <li>')
        __M_writer(
            filters.html_escape(
                filters.decode.utf8(course.display_number_with_default)))
        __M_writer(u'</li>\n')
        if course.advertised_start is not None:
            __M_writer(u'            <li>')
            __M_writer(filters.html_escape(filters.decode.utf8(_("Starts"))))
            __M_writer(u': <time itemprop="startDate">')
            __M_writer(
                filters.html_escape(
                    filters.decode.utf8(course.advertised_start)))
            __M_writer(u'</time></li>\n')
        else:
            __M_writer(u'            <li>')
            __M_writer(filters.html_escape(filters.decode.utf8(_("Starts"))))
            __M_writer(
                u': <time class="localized_datetime" itemprop="startDate" data-format="shortDate" data-datetime="'
            )
            __M_writer(
                filters.html_escape(filters.decode.utf8(course_date_string)))
            __M_writer(u'" data-language="')
            __M_writer(filters.html_escape(filters.decode.utf8(LANGUAGE_CODE)))
            __M_writer(u'"></time></li>\n')
        __M_writer(u'      </ul>\n    </div>\n  </a>\n</article>\n')

        def ccall(caller):
            def body():
                __M_writer = context.writer()
                __M_writer(
                    u'\n    DateUtilFactory.transform(iterationKey=".localized_datetime");\n'
                )
                return ''

            return [body]

        context.caller_stack.nextcaller = runtime.Namespace(
            'caller', context, callables=ccall(__M_caller))
        try:
            __M_writer(
                filters.html_escape(
                    filters.decode.utf8(
                        static.require_module_async(
                            class_name=u'DateUtilFactory',
                            module_name=u'js/dateutil_factory'))))
        finally:
            context.caller_stack.nextcaller = None
        __M_writer(u'\n')
        return ''
    finally:
        context.caller_stack._pop_frame()
예제 #14
0
def render_body(context, **pageargs):
    __M_caller = context.caller_stack._push_frame()
    try:
        __M_locals = __M_dict_builtin(pageargs=pageargs)
        disable_window_wrap = context.get('disable_window_wrap', UNDEFINED)
        disable_courseware_js = context.get('disable_courseware_js', UNDEFINED)
        EDX_ROOT_URL = context.get('EDX_ROOT_URL', UNDEFINED)
        static = _mako_get_namespace(context, 'static')
        unicode = context.get('unicode', UNDEFINED)
        LANGUAGE_CODE = context.get('LANGUAGE_CODE', UNDEFINED)
        disable_footer = context.get('disable_footer', UNDEFINED)

        def bodyclass():
            return render_bodyclass(context._locals(__M_locals))

        def js_overrides():
            return render_js_overrides(context._locals(__M_locals))

        self = context.get('self', UNDEFINED)
        getattr = context.get('getattr', UNDEFINED)

        def js_extra():
            return render_js_extra(context._locals(__M_locals))

        def marketing_hero():
            return render_marketing_hero(context._locals(__M_locals))

        uses_bootstrap = context.get('uses_bootstrap', UNDEFINED)

        def footer_extra():
            return render_footer_extra(context._locals(__M_locals))

        def headextra():
            return render_headextra(context._locals(__M_locals))

        uses_pattern_library = context.get('uses_pattern_library', UNDEFINED)
        hasattr = context.get('hasattr', UNDEFINED)

        def head_extra():
            return render_head_extra(context._locals(__M_locals))

        def bodyextra():
            return render_bodyextra(context._locals(__M_locals))

        disable_header = context.get('disable_header', UNDEFINED)

        def title():
            return render_title(context._locals(__M_locals))

        is_from_mobile_app = context.get('is_from_mobile_app', UNDEFINED)
        allow_iframing = context.get('allow_iframing', UNDEFINED)
        settings = context.get('settings', UNDEFINED)
        __M_writer = context.writer()
        __M_writer(u'\n')
        __M_writer(u'\n')
        __M_writer(u'\n\n\n')
        __M_writer(u'\n')
        online_help_token = self.online_help_token() if hasattr(
            self, 'online_help_token') else None

        __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 ['online_help_token']
                              if __M_key in __M_locals_builtin_stored]))
        __M_writer(u'\n')
        __M_writer(
            u'\n<!DOCTYPE html>\n<!--[if lte IE 9]><html class="ie ie9 lte9" lang="'
        )
        __M_writer(filters.decode.utf8(LANGUAGE_CODE))
        __M_writer(u'"><![endif]-->\n<!--[if !IE]><!--><html lang="')
        __M_writer(filters.decode.utf8(LANGUAGE_CODE))
        __M_writer(u'"><!--<![endif]-->\n<head dir="')
        __M_writer(filters.decode.utf8(static.dir_rtl()))
        __M_writer(
            u'">\n    <meta charset="UTF-8">\n    <meta http-equiv="X-UA-Compatible" content="IE=edge">\n    <meta name="viewport" content="width=device-width, initial-scale=1">\n\n'
        )
        __M_writer(u'\n')
        __M_writer(u'\n  ')
        if 'parent' not in context._data or not hasattr(
                context._data['parent'], 'title'):
            context['self'].title(**pageargs)

        __M_writer(u'\n\n')
        if not allow_iframing:
            __M_writer(
                u'      <script type="text/javascript">\n        /* immediately break out of an iframe if coming from the marketing website */\n        (function(window) {\n          if (window.location !== window.top.location) {\n            window.top.location = window.location;\n          }\n        })(this);\n      </script>\n'
            )
        __M_writer(u'\n  ')

        jsi18n_path = "js/i18n/{language}/djangojs.js".format(
            language=LANGUAGE_CODE)
        ie11_fix_path = "js/ie11_find_array.js"

        __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 ['jsi18n_path', 'ie11_fix_path']
                              if __M_key in __M_locals_builtin_stored]))
        __M_writer(u'\n\n')
        if getattr(settings, 'CAPTURE_CONSOLE_LOG', False):
            __M_writer(
                u'    <script type="text/javascript">\n      var oldOnError = window.onerror;\n      window.localStorage.setItem(\'console_log_capture\', JSON.stringify([]));\n\n      window.onerror = function (message, url, lineno, colno, error) {\n        if (oldOnError) {\n          oldOnError.apply(this, arguments);\n        }\n\n        var messages = JSON.parse(window.localStorage.getItem(\'console_log_capture\'));\n        messages.push([message, url, lineno, colno, (error || {}).stack]);\n        window.localStorage.setItem(\'console_log_capture\', JSON.stringify(messages));\n      }\n    </script>\n'
            )
        __M_writer(u'  <script type="text/javascript" src="')
        __M_writer(filters.decode.utf8(static.url(jsi18n_path)))
        __M_writer(u'"></script>\n  <script type="text/javascript" src="')
        __M_writer(filters.decode.utf8(static.url(ie11_fix_path)))
        __M_writer(
            u'"></script>\n\n  <link rel="icon" type="image/x-icon" href="')
        __M_writer(
            filters.decode.utf8(
                static.url(
                    static.get_value('favicon_path', settings.FAVICON_PATH))))
        __M_writer(u'" />\n\n  ')

        def ccall(caller):
            def body():
                __M_writer = context.writer()
                return ''

            return [body]

        context.caller_stack.nextcaller = runtime.Namespace(
            'caller', context, callables=ccall(__M_caller))
        try:
            __M_writer(filters.decode.utf8(static.css(group=u'style-vendor')))
        finally:
            context.caller_stack.nextcaller = None
        __M_writer(u'\n')
        if '/' in self.attr.main_css:
            if get_language_bidi():
                __M_writer(u'      ')

                rtl_css_file = self.attr.main_css.replace('.css', '-rtl.css')

                __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 ['rtl_css_file']
                        if __M_key in __M_locals_builtin_stored
                    ]))
                __M_writer(u'\n      <link rel="stylesheet" href="')
                __M_writer(
                    filters.decode.utf8(unicode(static.url(rtl_css_file))))
                __M_writer(u'" type="text/css" media="all" />\n')
            else:
                __M_writer(u'      <link rel="stylesheet" href="')
                __M_writer(filters.decode.utf8(static.url(self.attr.main_css)))
                __M_writer(u'" type="text/css" media="all" />\n')
        else:
            __M_writer(u'    ')

            def ccall(caller):
                def body():
                    __M_writer = context.writer()
                    return ''

                return [body]

            context.caller_stack.nextcaller = runtime.Namespace(
                'caller', context, callables=ccall(__M_caller))
            try:
                __M_writer(
                    filters.decode.utf8(
                        static.css(group=(self.attr.main_css))))
            finally:
                context.caller_stack.nextcaller = None
            __M_writer(u'\n')
        __M_writer(u'\n')
        if disable_courseware_js or uses_pattern_library:
            __M_writer(u'    ')

            def ccall(caller):
                def body():
                    __M_writer = context.writer()
                    return ''

                return [body]

            context.caller_stack.nextcaller = runtime.Namespace(
                'caller', context, callables=ccall(__M_caller))
            try:
                __M_writer(filters.decode.utf8(
                    static.js(group=u'base_vendor')))
            finally:
                context.caller_stack.nextcaller = None
            __M_writer(u'\n    ')

            def ccall(caller):
                def body():
                    __M_writer = context.writer()
                    return ''

                return [body]

            context.caller_stack.nextcaller = runtime.Namespace(
                'caller', context, callables=ccall(__M_caller))
            try:
                __M_writer(
                    filters.decode.utf8(static.js(group=u'base_application')))
            finally:
                context.caller_stack.nextcaller = None
            __M_writer(u'\n')
        else:
            __M_writer(u'    ')

            def ccall(caller):
                def body():
                    __M_writer = context.writer()
                    return ''

                return [body]

            context.caller_stack.nextcaller = runtime.Namespace(
                'caller', context, callables=ccall(__M_caller))
            try:
                __M_writer(filters.decode.utf8(
                    static.js(group=u'main_vendor')))
            finally:
                context.caller_stack.nextcaller = None
            __M_writer(u'\n    ')

            def ccall(caller):
                def body():
                    __M_writer = context.writer()
                    return ''

                return [body]

            context.caller_stack.nextcaller = runtime.Namespace(
                'caller', context, callables=ccall(__M_caller))
            try:
                __M_writer(filters.decode.utf8(
                    static.js(group=u'application')))
            finally:
                context.caller_stack.nextcaller = None
            __M_writer(u'\n')
        __M_writer(u'\n  ')

        def ccall(caller):
            def body():
                __M_writer = context.writer()
                return ''

            return [body]

        context.caller_stack.nextcaller = runtime.Namespace(
            'caller', context, callables=ccall(__M_caller))
        try:
            __M_writer(filters.decode.utf8(static.webpack(entry=u'commons')))
        finally:
            context.caller_stack.nextcaller = None
        __M_writer(u'\n\n')
        if uses_bootstrap:
            __M_writer(u'    <script type="text/javascript" src="')
            __M_writer(
                filters.decode.utf8(
                    static.url('common/js/vendor/bootstrap.bundle.js')))
            __M_writer(u'"></script>\n')
        __M_writer(u'\n  <script>\n    window.baseUrl = "')
        __M_writer(js_escaped_string(settings.STATIC_URL))
        __M_writer(
            u'";\n    (function (require) {\n      require.config({\n          baseUrl: window.baseUrl\n      });\n    }).call(this, require || RequireJS.require);\n  </script>\n  <script type="text/javascript" src="'
        )
        __M_writer(filters.decode.utf8(static.url("lms/js/require-config.js")))
        __M_writer(u'"></script>\n  ')
        if 'parent' not in context._data or not hasattr(
                context._data['parent'], 'js_overrides'):
            context['self'].js_overrides(**pageargs)

        __M_writer(u'\n\n  ')
        if 'parent' not in context._data or not hasattr(
                context._data['parent'], 'headextra'):
            context['self'].headextra(**pageargs)

        __M_writer(u'\n  ')
        if 'parent' not in context._data or not hasattr(
                context._data['parent'], 'head_extra'):
            context['self'].head_extra(**pageargs)

        __M_writer(
            u'\n\n    <link rel="stylesheet" type="text/css" href="/static/')
        __M_writer(
            filters.decode.utf8(
                settings.FEATURES.get(
                    'MARVEL_YELLOW_DEFAULT_HAWTHORN_SITE_THEME',
                    settings.DEFAULT_SITE_THEME)))
        __M_writer(u'/css/custom.css"></link>\n\n  ')
        runtime._include_file(context, u'/courseware/experiments.html',
                              _template_uri)
        __M_writer(u'\n  ')
        runtime._include_file(context, u'user_metadata.html', _template_uri)
        __M_writer(u'\n  ')

        def ccall(caller):
            def body():
                __M_writer = context.writer()
                return ''

            return [body]

        context.caller_stack.nextcaller = runtime.Namespace(
            'caller', context, callables=ccall(__M_caller))
        try:
            __M_writer(
                filters.decode.utf8(
                    static.optional_include_mako(is_theming_enabled=u'True',
                                                 file=u'head-extra.html')))
        finally:
            context.caller_stack.nextcaller = None
        __M_writer(u'\n\n  ')
        runtime._include_file(context, u'widgets/optimizely.html',
                              _template_uri)
        __M_writer(u'\n  ')
        runtime._include_file(context, u'widgets/segment-io.html',
                              _template_uri)
        __M_writer(u'\n\n  <meta name="path_prefix" content="')
        __M_writer(filters.decode.utf8(EDX_ROOT_URL))
        __M_writer(u'">\n  \n  ')
        google_site_verification_id = configuration_helpers.get_value(
            'GOOGLE_SITE_VERIFICATION_ID',
            settings.GOOGLE_SITE_VERIFICATION_ID)

        __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 ['google_site_verification_id']
                              if __M_key in __M_locals_builtin_stored]))
        __M_writer(u'\n')
        if google_site_verification_id:
            __M_writer(u'    <meta name="google-site-verification" content="')
            __M_writer(filters.decode.utf8(google_site_verification_id))
            __M_writer(u'" />\n')
        __M_writer(u'\n  <meta name="openedx-release-line" content="')
        __M_writer(filters.decode.utf8(RELEASE_LINE))
        __M_writer(u'" />\n\n')
        ga_acct = static.get_value("GOOGLE_ANALYTICS_ACCOUNT",
                                   settings.GOOGLE_ANALYTICS_ACCOUNT)

        __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 ['ga_acct']
                              if __M_key in __M_locals_builtin_stored]))
        __M_writer(u'\n')
        if ga_acct:
            __M_writer(
                u'    <script type="text/javascript">\n    var _gaq = _gaq || [];\n    _gaq.push([\'_setAccount\', \''
            )
            __M_writer(js_escaped_string(ga_acct))
            __M_writer(
                u"']);\n    _gaq.push(['_trackPageview']);\n\n    (function() {\n      var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\n      ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\n      var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\n    })();\n    </script>\n"
            )
        __M_writer(u'\n')
        branch_key = static.get_value("BRANCH_IO_KEY", settings.BRANCH_IO_KEY)

        __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 ['branch_key']
                              if __M_key in __M_locals_builtin_stored]))
        __M_writer(u'\n')
        if branch_key and not is_from_mobile_app:
            __M_writer(
                u'    <script type="text/javascript">\n        (function(b,r,a,n,c,h,_,s,d,k){if(!b[n]||!b[n]._q){for(;s<_.length;)c(h,_[s++]);d=r.createElement(a);d.async=1;d.src="https://cdn.branch.io/branch-latest.min.js";k=r.getElementsByTagName(a)[0];k.parentNode.insertBefore(d,k);b[n]=h}})(window,document,"script","branch",function(b,r){b[r]=function(){b._q.push([r,arguments])}},{_q:[],_v:1},"addListener applyCode banner closeBanner creditHistory credits data deepview deepviewCta first getCode init link logout redeem referrals removeListener sendSMS setBranchViewData setIdentity track validateCode".split(" "), 0);\n        branch.init(\''
            )
            __M_writer(js_escaped_string(branch_key))
            __M_writer(u"');\n    </script>\n")
        __M_writer(u'\n</head>\n\n<body class="')
        __M_writer(filters.decode.utf8(static.dir_rtl()))
        __M_writer(u' ')
        if 'parent' not in context._data or not hasattr(
                context._data['parent'], 'bodyclass'):
            context['self'].bodyclass(**pageargs)

        __M_writer(u' lang_')
        __M_writer(filters.decode.utf8(LANGUAGE_CODE))
        __M_writer(
            u'">\n\n<svg style="display: none">\n    <symbol viewBox="0 0 1536 1536" id="ico-fs-expand">\n        <path d="M1283 413L928 768l355 355 144-144q29-31 70-14 39 17 39 59v448q0 26-19 45t-45 19h-448q-42 0-59-40-17-39 14-69l144-144-355-355-355 355 144 144q31 30 14 69-17 40-59 40H64q-26 0-45-19t-19-45v-448q0-42 40-59 39-17 69 14l144 144 355-355-355-355-144 144q-19 19-45 19-12 0-24-5-40-17-40-59V64q0-26 19-45T64 0h448q42 0 59 40 17 39-14 69L413 253l355 355 355-355-144-144q-31-30-14-69 17-40 59-40h448q26 0 45 19t19 45v448q0 42-39 59-13 5-25 5-26 0-45-19z" />\n    </symbol>\n    <symbol viewBox="0 0 1536 1536" id="ico-fs-shrink">\n        <path d="M768 832v448q0 26-19 45t-45 19-45-19l-144-144-332 332q-10 10-23 10t-23-10L23 1399q-10-10-10-23t10-23l332-332-144-144q-19-19-19-45t19-45 45-19h448q26 0 45 19t19 45zm755-672q0 13-10 23l-332 332 144 144q19 19 19 45t-19 45-45 19H832q-26 0-45-19t-19-45V256q0-26 19-45t45-19 45 19l144 144 332-332q10-10 23-10t23 10l114 114q10 10 10 23z" />\n    </symbol>\n    <symbol viewBox="0 0 35 35" id="ico-linkedin">\n        <title>linkedin</title>\n        <path d="M17.5 0C7.8 0 0 7.8 0 17.5S7.8 35 17.5 35 35 27.2 35 17.5C35 7.8 27.2 0 17.5 0zM13.1 26H8.8V10.7h4.4V26zM11.1 9.7c-1.1 0-2-0.9-2-2.1s0.9-2.1 2.1-2.1c1.1 0 2.1 0.9 2.1 2.1C13.1 8.8 12.2 9.7 11.1 9.7zM28.4 26h-4.4V16.5c0-1.1-0.3-1.9-1.7-1.9 -2.3 0-2.7 1.9-2.7 1.9v9.5h-4.4V10.7h4.4v1.5c0.6-0.5 2.2-1.5 4.4-1.5 1.4 0 4.4 0.8 4.4 6V26z" />\n    </symbol>\n    <symbol viewBox="0 0 35 35" id="ico-behance">\n        <title>behance</title>\n        <path d="M14.1 13.9c0-1.7-1.1-1.7-1.1-1.7h-0.6H8.3v3.5h4.3C13.4 15.8 14.1 15.5 14.1 13.9z" class="a" />\n        <path d="M13 18.2H8.3v4.2h4.4c0.7 0 1.9-0.2 1.9-2.1C14.6 18.2 13 18.2 13 18.2z" class="a" />\n        <path d="M24.8 15.8c-2.5 0-2.8 2.4-2.8 2.4h5.2C27.2 18.2 27.2 15.8 24.8 15.8z" class="a" />\n        <path d="M17.5 0C7.8 0 0 7.8 0 17.5S7.8 35 17.5 35 35 27.2 35 17.5 27.2 0 17.5 0zM21.3 10.3h6.6v2h-6.5V10.3zM18 20.6c0 4.8-5 4.7-5 4.7H8.3 8.2 4.7V9.4h3.5 0.1 4.6c2.5 0 4.5 1.4 4.5 4.2s-2.4 3-2.4 3C18.2 16.6 18 20.6 18 20.6zM24.8 23.1c2.6 0 2.5-1.7 2.5-1.7h2.8c0 4.5-5.4 4.2-5.4 4.2 -6.5 0-6.1-6.1-6.1-6.1s0-6.1 6.1-6.1c6.4 0 5.5 6.9 5.5 6.9H22C22 23.3 24.8 23.1 24.8 23.1z" class="a" />\n    </symbol>\n    <symbol viewBox="0 0 35 35" id="ico-facebook">\n        <title>facebook</title>\n        <path d="M17.5 0C7.8 0 0 7.8 0 17.5S7.8 35 17.5 35 35 27.2 35 17.5C35 7.8 27.2 0 17.5 0zM23.6 9.6h-2.2c-0.8 0-1.4 0.2-1.6 0.5 -0.3 0.3-0.4 0.9-0.4 1.5v2.7h4.2l-0.5 4.2h-3.6v10.8h-4.3V18.5h-3.6V14.3h3.6v-3.1c0-1.8 0.5-3.1 1.5-4.1 1-1 2.3-1.5 3.9-1.5 1.4 0 2.5 0.1 3.2 0.2C23.6 5.9 23.6 9.6 23.6 9.6z" />\n    </symbol>\n    <symbol viewBox="0 0 35 35" id="ico-instagram">\n        <title>instagram</title>\n        <path d="M17.5 21c1.9 0 3.5-1.6 3.5-3.5 0-0.8-0.2-1.5-0.7-2 -0.6-0.9-1.7-1.5-2.8-1.5s-2.2 0.6-2.8 1.5c-0.4 0.6-0.7 1.3-0.7 2C14 19.4 15.6 21 17.5 21z" class="a" />\n        <polygon points="25.2 13.2 25.2 10.3 25.2 9.8 24.7 9.8 21.8 9.9 21.8 13.2 " class="a" />\n        <path d="M17.5 0C7.9 0 0 7.9 0 17.5S7.9 35 17.5 35 35 27.1 35 17.5 27.2 0 17.5 0zM27.5 15.5v8.1c0 2.1-1.7 3.8-3.8 3.8H11.4c-2.1 0-3.8-1.7-3.8-3.8v-8.1 -4.1c0-2.1 1.7-3.8 3.8-3.8h12.2c2.1 0 3.8 1.7 3.8 3.8L27.5 15.5 27.5 15.5z" class="a" />\n        <path d="M22.9 17.5c0 3-2.4 5.4-5.4 5.4s-5.4-2.4-5.4-5.4c0-0.7 0.1-1.4 0.4-2H9.5v8.1c0 1.1 0.9 1.9 1.9 1.9h12.2c1.1 0 1.9-0.9 1.9-1.9v-8.1h-3C22.8 16.1 22.9 16.8 22.9 17.5z" class="a" />\n    </symbol>\n    <symbol viewBox="0 0 35 35" id="ico-odnoklassniki">\n        <title>odnoklassniki</title>\n        <path d="M17.5 14.5c1.7 0 3-1.3 3-3s-1.3-3-3-3c-1.7 0-3 1.4-3 3C14.5 13.2 15.8 14.5 17.5 14.5z" class="a" />\n        <path d="M17.5 0C7.8 0 0 7.8 0 17.5S7.8 35 17.5 35 35 27.2 35 17.5 27.2 0 17.5 0zM17.5 5.3c3.4 0 6.1 2.8 6.1 6.2 0 3.4-2.8 6.1-6.2 6.1 -3.4 0-6.1-2.8-6.1-6.2C11.4 8.1 14.1 5.3 17.5 5.3zM24.4 20.1c-0.8 0.8-1.7 1.3-2.7 1.7 -1 0.4-2 0.6-3 0.7 0.2 0.2 0.2 0.3 0.3 0.4 1.4 1.4 2.8 2.8 4.2 4.2 0.5 0.5 0.6 1.1 0.3 1.6 -0.3 0.6-0.9 1-1.6 1 -0.4 0-0.7-0.2-1-0.5 -1.1-1.1-2.1-2.1-3.2-3.2 -0.3-0.3-0.4-0.3-0.7 0 -1.1 1.1-2.1 2.2-3.2 3.2 -0.5 0.5-1.1 0.6-1.6 0.3 -0.6-0.3-1-0.9-1-1.5 0-0.4 0.2-0.7 0.5-1 1.4-1.4 2.8-2.8 4.2-4.2 0.1-0.1 0.2-0.2 0.3-0.3 -1.9-0.2-3.6-0.7-5-1.8 -0.2-0.1-0.4-0.3-0.5-0.4 -0.6-0.6-0.7-1.3-0.2-2 0.4-0.6 1.2-0.8 1.9-0.4 0.1 0.1 0.3 0.2 0.4 0.2 2.7 1.9 6.4 1.9 9.2 0.1 0.3-0.2 0.6-0.4 0.9-0.5 0.7-0.2 1.3 0.1 1.6 0.6C24.9 18.9 24.9 19.6 24.4 20.1z" class="a" />\n    </symbol>\n    <symbol viewBox="0 0 35 35" id="ico-twitter">\n        <title>twitter</title>\n        <path d="M17.5 0C7.8 0 0 7.8 0 17.5S7.8 35 17.5 35 35 27.2 35 17.5C35 7.8 27.2 0 17.5 0zM26.2 13.6l0 0.6c0 5.7-4.3 12.3-12.3 12.3 -2.4 0-4.7-0.7-6.6-1.9 0.3 0 0.7 0.1 1 0.1 2 0 3.9-0.7 5.4-1.8 -1.9 0-3.5-1.3-4-3 0.3 0.1 0.5 0.1 0.8 0.1 0.4 0 0.8 0 1.1-0.1 -2-0.4-3.5-2.1-3.5-4.2v-0.1c0.6 0.3 1.2 0.5 2 0.5 -1.2-0.8-1.9-2.1-1.9-3.6 0-0.8 0.2-1.5 0.6-2.2 2.1 2.6 5.3 4.3 8.9 4.5 -0.1-0.3-0.1-0.6-0.1-1 0-2.4 1.9-4.3 4.3-4.3 1.2 0 2.4 0.5 3.1 1.4 1-0.2 1.9-0.6 2.7-1 -0.3 1-1 1.9-1.9 2.4 0.9-0.1 1.7-0.3 2.5-0.7C27.8 12.2 27 13 26.2 13.6z" />\n    </symbol>\n    <symbol viewBox="0 0 35 35" id="ico-vimeo">\n        <title>vimeo</title>\n        <path d="M17.5 0C7.8 0 0 7.8 0 17.5S7.8 35 17.5 35 35 27.2 35 17.5 27.2 0 17.5 0zM29.9 11.7c-0.1 2.4-1.8 5.7-5.1 9.9 -3.4 4.4-6.2 6.6-8.5 6.6 -1.4 0-2.7-1.3-3.7-4 -0.7-2.4-1.3-4.9-2-7.3 -0.7-2.7-1.5-4-2.4-4 -0.2 0-0.8 0.4-1.9 1.2l-1.2-1.5c1.2-1.1 2.4-2.1 3.6-3.2 1.6-1.4 2.9-2.1 3.7-2.2 1.9-0.2 3.1 1.1 3.6 4 0.5 3 0.8 4.9 1 5.7 0.6 2.5 1.2 3.8 1.8 3.8 0.5 0 1.3-0.8 2.3-2.5 1-1.6 1.6-2.9 1.7-3.7 0.1-1.4-0.4-2.1-1.7-2.1 -0.6 0-1.2 0.1-1.8 0.4 1.2-4 3.5-5.9 7-5.8C28.8 6.9 30 8.5 29.9 11.7z" />\n    </symbol>\n    <symbol viewBox="0 0 35 35" id="ico-vk">\n        <title>vk</title>\n        <path d="M17.5 0C7.8 0 0 7.8 0 17.5S7.8 35 17.5 35 35 27.2 35 17.5 27.2 0 17.5 0zM26.4 19.4c0.8 0.8 1.7 1.5 2.4 2.4 0.3 0.4 0.6 0.8 0.9 1.2 0.3 0.6 0 1.4-0.5 1.4l-3.6 0c-0.9 0.1-1.7-0.3-2.3-0.9 -0.5-0.5-1-1-1.4-1.6 -0.2-0.2-0.4-0.4-0.6-0.6 -0.5-0.3-0.9-0.2-1.2 0.3 -0.3 0.5-0.4 1.1-0.4 1.7 0 0.8-0.3 1.1-1.1 1.1 -1.8 0.1-3.5-0.2-5.1-1.1 -1.4-0.8-2.5-1.9-3.5-3.2 -1.9-2.5-3.3-5.3-4.5-8.1 -0.3-0.6-0.1-1 0.6-1 1.2 0 2.3 0 3.5 0 0.5 0 0.8 0.3 1 0.7 0.6 1.6 1.4 3 2.4 4.4 0.3 0.4 0.5 0.7 0.9 1 0.4 0.3 0.7 0.2 0.9-0.3 0.1-0.3 0.2-0.6 0.2-0.9 0.1-1.1 0.1-2.2-0.1-3.2 -0.1-0.7-0.5-1.1-1.2-1.2 -0.3-0.1-0.3-0.2-0.1-0.4 0.3-0.3 0.6-0.5 1.1-0.5l4.1 0c0.6 0.1 0.8 0.4 0.9 1.1l0 4.5c0 0.2 0.1 1 0.6 1.1 0.4 0.1 0.6-0.2 0.8-0.4 1-1 1.7-2.2 2.3-3.5 0.3-0.6 0.5-1.1 0.7-1.7 0.2-0.4 0.4-0.6 0.9-0.6l3.9 0c0.1 0 0.2 0 0.3 0 0.7 0.1 0.8 0.4 0.6 1 -0.3 1-0.9 1.8-1.5 2.7 -0.7 0.9-1.3 1.8-2 2.7C25.6 18.3 25.6 18.7 26.4 19.4z" />\n    </symbol>\n    <symbol viewBox="0 0 35 35" id="ico-youtube">\n        <title>youtube</title>\n        <path d="M15.2 24.5c0 0.3 0 0.5 0 0.6 0 0.2 0 0.2-0.1 0.3 0 0.2-0.2 0.3-0.4 0.4 -0.2 0.1-0.3 0-0.5-0.3 0 0 0-0.1 0-0.3 0-0.2 0-0.4 0-0.6l0-3.8h-1.4l0 3.8c0 0.3 0 0.5 0 0.7s0 0.4 0 0.5c0 0.2 0 0.3 0.1 0.5 0 0.2 0.1 0.3 0.3 0.5 0.2 0.1 0.4 0.2 0.6 0.2 0.2 0 0.4 0 0.7-0.1 0.2-0.1 0.4-0.2 0.6-0.3 0.2-0.1 0.3-0.3 0.4-0.4l0 0.8L16.7 26.8v-6.1h-1.4L15.2 24.5 15.2 24.5z" class="a" />\n        <path d="M20.1 20.5c-0.3 0-0.7 0.2-1.2 0.5V18.6h-1.4v8.2l1.2 0 0.1-0.5c0.4 0.3 0.7 0.5 1 0.6 0.3 0.1 0.6 0 0.8-0.1 0.2-0.1 0.4-0.3 0.5-0.6 0.1-0.3 0.2-0.6 0.2-1v-3.2c0-0.6-0.2-1-0.6-1.3C20.5 20.5 20.3 20.5 20.1 20.5zM20.2 25.3c0 0.1-0.1 0.2-0.2 0.3 -0.1 0.1-0.3 0.1-0.4 0.1 -0.2 0-0.3 0-0.4-0.1 -0.1-0.1-0.2-0.2-0.2-0.3v-3.6c0-0.1 0.1-0.2 0.2-0.3 0.1-0.1 0.3-0.1 0.4-0.1 0.2 0 0.3 0 0.4 0.1 0.1 0.1 0.2 0.2 0.2 0.3V25.3z" class="a" />\n        <polygon points="13.2 18.6 8.6 18.6 8.6 19.6 10.1 19.6 10.1 26.8 11.5 26.8 11.5 19.6 13.2 19.6 " class="a" />\n        <path d="M17.5 0C7.8 0 0 7.8 0 17.5S7.8 35 17.5 35 35 27.2 35 17.5C35 7.8 27.2 0 17.5 0zM20 12.7V8.5h1.3v4.9c0 0.1 0 0.2 0.1 0.3 0.1 0.1 0.2 0.1 0.4 0.1 0.1 0 0.3 0 0.4-0.1 0.1-0.1 0.2-0.2 0.2-0.3V8.5h1.2v6.3h-1.6l0-0.5c-0.1 0.2-0.3 0.4-0.4 0.5 -0.2 0.1-0.3 0.2-0.5 0.2 -0.2 0-0.4-0.1-0.6-0.2 -0.1-0.1-0.3-0.2-0.4-0.4 0-0.1-0.1-0.2-0.1-0.3 0-0.1 0-0.2 0-0.3 0-0.1 0-0.2 0-0.4L20 12.7 20 12.7zM16.1 8.6c0.3-0.2 0.6-0.3 1.1-0.3 0.4 0 0.7 0.1 1 0.2 0.3 0.1 0.5 0.3 0.6 0.5 0.1 0.2 0.2 0.4 0.3 0.6 0.1 0.3 0.1 0.6 0.1 1v1.6c0 0.6 0 1-0.1 1.3 0 0.2-0.1 0.5-0.3 0.8 -0.2 0.3-0.4 0.4-0.6 0.5 -0.3 0.1-0.6 0.2-0.9 0.2 -0.3 0-0.7 0-0.9-0.2 -0.3-0.1-0.5-0.2-0.6-0.4 -0.1-0.2-0.2-0.4-0.3-0.7 -0.1-0.3-0.1-0.7-0.1-1.3 0 0 0-1.7 0-1.7 0-0.6 0.1-1 0.2-1.4C15.6 9 15.8 8.7 16.1 8.6zM11.9 6l0.9 3.1 0.9-3.1h1.7l-1.8 4.2v4.8H12.2v-4.8l-1.9-4.2H11.9zM27.8 26c0 0.4-0.1 0.8-0.3 1.2 -0.2 0.4-0.4 0.7-0.7 0.9 -0.3 0.3-0.7 0.5-1.1 0.6 -0.4 0.2-0.8 0.2-1.3 0.2H10.6c-0.5 0-0.9-0.1-1.3-0.2 -0.4-0.2-0.8-0.4-1.1-0.6 -0.3-0.3-0.6-0.6-0.7-0.9 -0.2-0.4-0.3-0.7-0.3-1.2v-6.8c0-0.4 0.1-0.8 0.3-1.2 0.2-0.4 0.4-0.7 0.7-0.9 0.3-0.3 0.7-0.5 1.1-0.6 0.4-0.2 0.8-0.2 1.3-0.2H24.4c0.5 0 0.9 0.1 1.3 0.2s0.8 0.4 1.1 0.6c0.3 0.3 0.6 0.6 0.7 0.9 0.2 0.4 0.3 0.7 0.3 1.2V26z" class="a" />\n        <path d="M17.2 13.9c0.2 0 0.3-0.1 0.4-0.2 0.1-0.1 0.2-0.3 0.2-0.4V9.9c0-0.2-0.1-0.3-0.2-0.5 -0.1-0.1-0.3-0.2-0.4-0.2 -0.2 0-0.3 0.1-0.4 0.2 -0.1 0.1-0.2 0.3-0.2 0.5v3.4c0 0.2 0.1 0.3 0.2 0.4C16.9 13.9 17.1 13.9 17.2 13.9z" class="a" />\n        <path d="M24.7 24.7v0.2 0.5c0 0.2-0.1 0.3-0.2 0.4 -0.1 0.1-0.3 0.1-0.4 0.1h-0.2c-0.2 0-0.3 0-0.4-0.1 -0.1-0.1-0.2-0.2-0.2-0.4v-0.1 -0.6 -0.8h2.5v-0.8c0-0.3 0-0.6 0-0.9 0-0.3 0-0.5-0.1-0.7 0-0.3-0.2-0.5-0.4-0.7 -0.2-0.2-0.5-0.3-0.7-0.3 -0.3-0.1-0.6-0.1-0.9 0 -0.3 0-0.5 0.1-0.8 0.3 -0.3 0.2-0.5 0.4-0.6 0.8 -0.1 0.3-0.2 0.8-0.2 1.3v1.9c0 0.8 0.2 1.4 0.6 1.7 0.4 0.3 0.8 0.5 1.2 0.5 0 0 0.1 0 0.1 0 0.5 0 0.9-0.2 1.3-0.6 0.3-0.3 0.4-0.6 0.4-1.1 0-0.1 0-0.3-0.1-0.5H24.7v0h0V24.7zM23.3 22.1c0-0.2 0.1-0.3 0.2-0.4 0.1-0.1 0.3-0.2 0.4-0.2h0.1c0.2 0 0.3 0.1 0.5 0.2 0.1 0.1 0.2 0.2 0.2 0.4l0 0.8h-1.4L23.3 22.1z" class="a" />\n    </symbol>\n    <symbol viewBox="0 0 78.1 16" style="enable-background:new 0 0 78.1 16;" id="logo-edx" class="test">\n        <title>logo-edx</title>\n\n        <g>\n            <g>\n                <path class="st0" fill="#fff" d="M14,15.8v-12h3.2c0.7,0,1.3,0,1.7,0.1c0.5,0.1,1,0.3,1.4,0.5C20.7,4.6,21,5,21.2,5.5c0.2,0.5,0.3,1,0.3,1.5\n\t\t\tc0,1-0.3,1.8-0.9,2.4c-0.6,0.7-1.7,1-3.3,1h-1.8v5.4H14z M15.5,9.1h1.9c1,0,1.6-0.2,2-0.5C19.8,8.2,20,7.7,20,7\n\t\t\tc0-0.5-0.1-0.9-0.4-1.2c-0.2-0.3-0.5-0.6-0.9-0.7c-0.2-0.1-0.7-0.1-1.4-0.1h-1.8V9.1z"/>\n                <path class="st0" fill="#fff" d="M23.3,15.8v-12h7.6v1.3h-6.1v3.8h5.8v1.3h-5.8v4.3h6.3v1.3H23.3z"/>\n                <path class="st0" fill="#fff" d="M33,15.8v-12h1.5l6.7,9.6V3.8h1.4v12h-1.5l-6.7-9.7v9.7H33z"/>\n                <g>\n                    <path class="st0" fill="#fff" d="M10.5,5.2c1.2,1.2,1.8,2.7,1.8,4.5s-0.6,3.2-1.8,4.5C9.3,15.4,7.9,16,6.2,16c-1.7,0-3.2-0.6-4.4-1.8\n\t\t\t\tC0.6,12.9,0,11.4,0,9.7s0.6-3.2,1.8-4.5C3,4,4.5,3.4,6.2,3.4C7.9,3.4,9.3,4,10.5,5.2z M6.2,5C4.9,5,3.8,5.5,2.9,6.4\n\t\t\t\tC2,7.3,1.6,8.4,1.6,9.7C1.6,11,2,12.1,2.9,13c0.9,0.9,2,1.4,3.2,1.4c1.3,0,2.4-0.5,3.3-1.4c0.9-0.9,1.3-2,1.3-3.3\n\t\t\t\tc0-1.3-0.4-2.4-1.3-3.3C8.5,5.5,7.4,5,6.2,5z"/>\n                </g>\n            </g>\n            <path class="st1" fill="#fff" d="M63.6,0c0,0.8,0,2.5,0,2.5l1.3,0c0,0,0.2,0.2,0.3,0.3c0,0,0,0,0,0c0,3.3,0,6.5,0,9.8c0,0,0,0,0,0\n\t\tc-0.1,0.2-0.3,0.4-0.4,0.5c-0.4,0-0.8,0-1.2,0c0,0.9,0,1.7,0,2.6c-0.3,0-0.6,0-0.9,0c0-0.4,0-0.7,0-1.1c-0.8,0.5-1.8,1-3,1.1\n\t\tc-0.3,0-0.5,0-0.8,0c-1.9-0.2-3.1-0.9-4.1-2c0,0,0,0,0,0c0.5-0.5,0.8-1.1,1.1-1.7c-0.7,0-1.5,0-2.2,0c0,0,0,0,0,0\n\t\tc-0.2-0.4-0.3-0.9-0.4-1.4c0,0,0,0,0,0c0.8,0,1.7,0,2.6,0c0,0,0,0,0,0c0.5,1.5,1.9,2.8,4,2.5c1.5-0.2,2.8-1.5,2.9-3.2\n\t\tc0.1-1.3-0.3-2.1-1-2.8c-0.5-0.5-1.2-1-2.1-1c-1.8-0.1-2.8,0.8-3.4,1.9c0,0,0,0,0,0c-0.3-1-0.7-1.8-1.3-2.4c0,0,0,0,0,0\n\t\tc0.8-0.9,2-1.7,3.6-1.9c1.7-0.3,3.3,0.3,4.3,1c0-0.7,0-1.4,0-2.1c-0.5,0-1.1,0-1.6,0c0-0.8,0-1.7,0-2.5C61.8,0,62.7,0,63.6,0z"/>\n            <path class="st2" fill="#fff" d="M63.6,0c0.5,0,1.1,0,1.6,0c0,0.9,0,1.9,0,2.8c-0.1-0.1-0.3-0.3-0.3-0.3l-1.3,0C63.6,2.5,63.6,0.8,63.6,0z"/>\n            <path class="st3" fill="#fff" d="M65.1,0c1.5,0,3.1,0,4.6,0c0,0.8,0,1.6,0,2.5c-0.5,0-1,0-1.4,0c0.8,1,1.7,2.1,2.5,3.1c0.8-1,1.7-2,2.5-3.1\n\t\tc0,0,0,0,0,0c-0.5,0-0.9,0-1.4,0c0-0.8,0-1.6,0-2.5c2.1,0,4.1,0,6.2,0c0,0.8,0,1.6,0,2.5c-0.4,0-0.9,0-1.3,0\n\t\tC75.4,4.2,74,6,72.6,7.7c1.4,1.8,2.9,3.6,4.4,5.4c0.4,0,0.8,0,1.2,0c0,0.9,0,1.7,0,2.6c-2.1,0-4.1,0-6.2,0c0-0.9,0-1.7,0-2.6\n\t\tc0.5,0,1,0,1.5,0c-0.8-1.1-1.8-2.2-2.6-3.3c-0.9,1.1-1.8,2.2-2.7,3.3c0.5,0,1,0,1.6,0c0,0.9,0,1.7,0,2.6c-0.9,0-1.8,0-2.7,0\n\t\tc0-0.8,0-1.7,0-2.5c-0.6,0-1.3,0-1.9,0c0-0.2,0-0.3,0-0.5c0,0,0,0,0,0c1.3-1.6,2.7-3.3,4-4.9c-1.3-1.7-2.6-3.3-4-4.9c0,0,0,0,0,0\n\t\tC65.1,1.9,65.1,0.9,65.1,0z"/>\n            <path class="st4" fill="#fff" d="M68.4,2.5c0.4,0,0.9,0,1.4,0C69.3,2.5,68.8,2.5,68.4,2.5z"/>\n            <path class="st4" fill="#fff" d="M72,2.5c0.5,0,0.9,0,1.4,0c0,0,0,0,0,0C72.9,2.5,72.4,2.5,72,2.5z"/>\n            <path class="st4" fill="#fff" d="M76.8,2.5c0.4,0,0.9,0,1.3,0C77.7,2.5,77.3,2.5,76.8,2.5z"/>\n            <path class="st4" fill="#fff" d="M50.1,3.5c0.1,0,0.4,0,0.5,0C50.4,3.5,50.2,3.5,50.1,3.5z"/>\n            <path class="st1" fill="#fff" d="M46.2,5.1c1-0.8,2.1-1.5,3.9-1.6c0.2,0,0.3,0,0.5,0c1.7,0.1,2.8,0.7,3.8,1.6c0.1,0.1,0.2,0.2,0.3,0.3\n\t\tc0,0,0.1,0.1,0.1,0.1c0,0,0,0,0,0c-0.6,0.6-1.1,1.4-1.4,2.4c0,0,0,0,0,0c-0.6-1-1.4-1.8-2.9-1.9c-0.1,0-0.2,0-0.3,0\n\t\tc-1,0-1.6,0.4-2.2,0.9c-0.1,0.1-0.2,0.2-0.3,0.3c-0.3,0.4-0.6,0.8-0.7,1.3c2.1,0,4.2,0,6.3,0c-0.1,0.6-0.1,1.4,0,2c0,0,0,0,0,0\n\t\tc-2.1,0-4.2,0-6.3,0c0.4,1.2,1.2,2.1,2.4,2.4c1.3,0.4,2.5-0.1,3.2-0.8c0.1-0.1,0.3-0.2,0.3-0.3c0.2,0,0.5,0,0.7,0c0,0,0,0,0,0\n\t\tc0.3,0.7,0.7,1.2,1.1,1.7c0,0,0,0,0,0c-1,1-2.2,1.8-4.1,2c-0.2,0-0.4,0-0.6,0c-1.7-0.1-3.1-0.8-4-1.8c-0.9-0.9-1.7-2.3-1.8-4\n\t\tc0-0.2,0-0.3,0-0.5c0.1-1.7,0.7-2.9,1.6-3.9C46,5.4,46.1,5.3,46.2,5.1z"/>\n            <path class="st2" fill="#fff" d="M54.7,5.5c0.6,0.7,1,1.4,1.3,2.4c-0.4,0.6-0.5,1.8-0.3,2.6c-0.9,0-1.7,0-2.6,0c-0.1-0.6-0.1-1.4,0-2\n\t\tc0.1,0,0.3,0,0.4,0c0-0.2-0.1-0.4-0.2-0.6C53.7,7,54.1,6.1,54.7,5.5z"/>\n            <path class="st4" fill="#fff" d="M53.3,7.9C53.4,7.9,53.4,7.9,53.3,7.9c0.1,0.2,0.2,0.4,0.3,0.6c-0.1,0-0.3,0-0.4,0C53.3,8.3,53.3,8.1,53.3,7.9\n\t\tz"/>\n            <path class="st5" fill="#fff" d="M56,7.9C56,7.9,56,7.9,56,7.9c0.2,0.8,0.3,1.8,0.1,2.6c-0.1,0-0.3,0-0.4,0c0,0,0,0,0,0\n\t\tC55.5,9.7,55.7,8.6,56,7.9z"/>\n            <path class="st2" fill="#fff" d="M53.6,12c0.7,0,1.5,0,2.2,0c-0.3,0.7-0.6,1.3-1.1,1.7C54.3,13.2,53.9,12.6,53.6,12z"/>\n            <path class="st2" fill="#fff" d="M65.1,12.6c0,0.2,0,0.3,0,0.5c0.6,0,1.3,0,1.9,0c0,0.8,0,1.7,0,2.5c-1.2,0-2.3,0-3.5,0c0-0.9,0-1.7,0-2.6\n\t\tc0.4,0,0.8,0,1.2,0C64.9,13,65,12.8,65.1,12.6z"/>\n            <path class="st4" fill="#fff" d="M54.4,5.1c0.1,0.1,0.2,0.2,0.3,0.3C54.5,5.3,54.4,5.2,54.4,5.1z"/>\n            <path class="st4" fill="#fff" d="M47.6,7.2C47.7,7.1,47.8,7,47.9,7C47.8,7.1,47.8,7.2,47.6,7.2z"/>\n        </g>\n\n    </symbol>\n    <symbol viewBox="0 0 100 100" id="logo-raccoon">\n        <path d="M68.6 10.2v12.6L57.3 20.3h0L50 20.3v0l-7.2 0h0l-11.3 2.5V10.2L12.8 28.9 0.9 40.7l0 0 9.2 9.2 13.5 13.5 9.3 9.3L50 89.8v0l17.1-17.1 9.3-9.3 13.4-13.5 9.2-9.2 -11.8-11.9L68.6 10.2zM64.3 71.8l0 0L50 66.7v0l-14.3 5.2 0 0 -9.7-9.8 9.6-5.9L50 53v0l14.4 3.1 9.6 5.9L64.3 71.8zM95.3 40.7l-7.5 7.6h0l-9.5-7.5 -9.6-3.9 -7.9 3.9L50 46V45.9l-10.7-5.2 -7.9-3.9 -9.6 3.9 -9.5 7.5 0 0 -7.5-7.6 0 0 12.6-12.6 11.6-11.6 0 9.9 0.1 0 14.7-3.6 0 0H50v0h6.4l14.7 3.6 0.1 0 0-9.9L82.7 28.1l12.6 12.6V40.7z" fill="#FFF" />\n    </symbol>\n</svg>\n\n'
        )

        def ccall(caller):
            def body():
                __M_writer = context.writer()
                return ''

            return [body]

        context.caller_stack.nextcaller = runtime.Namespace(
            'caller', context, callables=ccall(__M_caller))
        try:
            __M_writer(
                filters.decode.utf8(
                    static.optional_include_mako(is_theming_enabled=u'True',
                                                 file=u'body-initial.html')))
        finally:
            context.caller_stack.nextcaller = None
        __M_writer(u'\n<div id="page-prompt"></div>\n')
        if not disable_window_wrap:
            __M_writer(u'  <div class="window-wrap" dir="')
            __M_writer(filters.decode.utf8(static.dir_rtl()))
            __M_writer(u'">\n')
        __M_writer(
            u'    <a class="nav-skip sr-only sr-only-focusable" href="#main">')
        __M_writer(filters.decode.utf8(_("Skip to main content")))
        __M_writer(u'</a>\n\n')
        if not disable_header:
            __M_writer(u'        ')
            runtime._include_file(context,
                                  (static.get_template_path('header.html')),
                                  _template_uri,
                                  online_help_token=online_help_token)
            __M_writer(u'\n        ')
            runtime._include_file(context, u'/preview_menu.html',
                                  _template_uri)
            __M_writer(u'\n')
        __M_writer(u'\n    ')
        runtime._include_file(context, u'/page_banner.html', _template_uri)
        __M_writer(u'\n\n    <div class="marketing-hero">')
        if 'parent' not in context._data or not hasattr(
                context._data['parent'], 'marketing_hero'):
            context['self'].marketing_hero(**pageargs)

        __M_writer(
            u'</div>\n\n    <div class="content-wrapper main-container" id="content">\n      '
        )
        __M_writer(filters.decode.utf8(self.body()))
        __M_writer(u'\n      ')
        if 'parent' not in context._data or not hasattr(
                context._data['parent'], 'bodyextra'):
            context['self'].bodyextra(**pageargs)

        __M_writer(u'\n    </div>\n\n')
        if not disable_footer:
            __M_writer(u'        ')
            runtime._include_file(context,
                                  (static.get_template_path('footer.html')),
                                  _template_uri)
            __M_writer(u'\n')
        __M_writer(u'\n')
        if not disable_window_wrap:
            __M_writer(u'  </div>\n')
        __M_writer(u'\n  ')
        if 'parent' not in context._data or not hasattr(
                context._data['parent'], 'footer_extra'):
            context['self'].footer_extra(**pageargs)

        __M_writer(u'\n  ')
        if 'parent' not in context._data or not hasattr(
                context._data['parent'], 'js_extra'):
            context['self'].js_extra(**pageargs)

        __M_writer(u'\n\n  ')
        runtime._include_file(context, u'widgets/segment-io-footer.html',
                              _template_uri)
        __M_writer(u'\n  <script type="text/javascript" src="')
        __M_writer(filters.decode.utf8(static.url('js/vendor/noreferrer.js')))
        __M_writer(
            u'" charset="utf-8"></script>\n  <script type="text/javascript" src="'
        )
        __M_writer(filters.decode.utf8(static.url('js/utils/navigation.js')))
        __M_writer(
            u'" charset="utf-8"></script>\n  <script type="text/javascript" src="'
        )
        __M_writer(filters.decode.utf8(static.url('js/header/header.js')))
        __M_writer(u'"></script>\n  ')

        def ccall(caller):
            def body():
                __M_writer = context.writer()
                return ''

            return [body]

        context.caller_stack.nextcaller = runtime.Namespace(
            'caller', context, callables=ccall(__M_caller))
        try:
            __M_writer(
                filters.decode.utf8(
                    static.optional_include_mako(is_theming_enabled=u'True',
                                                 file=u'body-extra.html')))
        finally:
            context.caller_stack.nextcaller = None
        __M_writer(u'\n</body>\n</html>\n\n')
        __M_writer(u'\n')
        return ''
    finally:
        context.caller_stack._pop_frame()
예제 #15
0
파일: main.html.py 프로젝트: lxp20201/lxp
def render_body(context, **pageargs):
    __M_caller = context.caller_stack._push_frame()
    try:
        __M_locals = __M_dict_builtin(pageargs=pageargs)
        disable_window_wrap = context.get('disable_window_wrap', UNDEFINED)
        disable_courseware_js = context.get('disable_courseware_js', UNDEFINED)
        EDX_ROOT_URL = context.get('EDX_ROOT_URL', UNDEFINED)
        static = _mako_get_namespace(context, 'static')
        unicode = context.get('unicode', UNDEFINED)
        LANGUAGE_CODE = context.get('LANGUAGE_CODE', UNDEFINED)
        disable_footer = context.get('disable_footer', UNDEFINED)

        def bodyclass():
            return render_bodyclass(context._locals(__M_locals))

        def js_overrides():
            return render_js_overrides(context._locals(__M_locals))

        self = context.get('self', UNDEFINED)
        getattr = context.get('getattr', UNDEFINED)

        def js_extra():
            return render_js_extra(context._locals(__M_locals))

        def marketing_hero():
            return render_marketing_hero(context._locals(__M_locals))

        uses_bootstrap = context.get('uses_bootstrap', UNDEFINED)

        def footer_extra():
            return render_footer_extra(context._locals(__M_locals))

        def headextra():
            return render_headextra(context._locals(__M_locals))

        uses_pattern_library = context.get('uses_pattern_library', UNDEFINED)
        hasattr = context.get('hasattr', UNDEFINED)

        def head_extra():
            return render_head_extra(context._locals(__M_locals))

        def bodyextra():
            return render_bodyextra(context._locals(__M_locals))

        disable_header = context.get('disable_header', UNDEFINED)

        def title():
            return render_title(context._locals(__M_locals))

        is_from_mobile_app = context.get('is_from_mobile_app', UNDEFINED)
        allow_iframing = context.get('allow_iframing', UNDEFINED)
        settings = context.get('settings', UNDEFINED)
        __M_writer = context.writer()
        __M_writer(u'\n')
        __M_writer(u'\n')
        __M_writer(u'\n\n\n')
        __M_writer(u'\n')
        online_help_token = self.online_help_token() if hasattr(
            self, 'online_help_token') else None

        __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 ['online_help_token']
                              if __M_key in __M_locals_builtin_stored]))
        __M_writer(u'\n')
        __M_writer(
            u'\n<!DOCTYPE html>\n<!--[if lte IE 9]><html class="ie ie9 lte9" lang="'
        )
        __M_writer(filters.decode.utf8(LANGUAGE_CODE))
        __M_writer(u'"><![endif]-->\n<!--[if !IE]><!--><html lang="')
        __M_writer(filters.decode.utf8(LANGUAGE_CODE))
        __M_writer(u'"><!--<![endif]-->\n<head dir="')
        __M_writer(filters.decode.utf8(static.dir_rtl()))
        __M_writer(
            u'">\n    <meta charset="UTF-8">\n    <meta http-equiv="X-UA-Compatible" content="IE=edge">\n    <meta name="viewport" content="width=device-width, initial-scale=1">\n\n'
        )
        __M_writer(u'\n')
        __M_writer(u'\n  ')
        if 'parent' not in context._data or not hasattr(
                context._data['parent'], 'title'):
            context['self'].title(**pageargs)

        __M_writer(u'\n\n')
        if not allow_iframing:
            __M_writer(
                u'      <script type="text/javascript">\n        /* immediately break out of an iframe if coming from the marketing website */\n        (function(window) {\n          if (window.location !== window.top.location) {\n            window.top.location = window.location;\n          }\n        })(this);\n      </script>\n'
            )
        __M_writer(u'\n  ')

        jsi18n_path = "js/i18n/{language}/djangojs.js".format(
            language=LANGUAGE_CODE)
        ie11_fix_path = "js/ie11_find_array.js"

        __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 ['jsi18n_path', 'ie11_fix_path']
                              if __M_key in __M_locals_builtin_stored]))
        __M_writer(u'\n\n')
        if getattr(settings, 'CAPTURE_CONSOLE_LOG', False):
            __M_writer(
                u'    <script type="text/javascript">\n      var oldOnError = window.onerror;\n      window.localStorage.setItem(\'console_log_capture\', JSON.stringify([]));\n\n      window.onerror = function (message, url, lineno, colno, error) {\n        if (oldOnError) {\n          oldOnError.apply(this, arguments);\n        }\n\n        var messages = JSON.parse(window.localStorage.getItem(\'console_log_capture\'));\n        messages.push([message, url, lineno, colno, (error || {}).stack]);\n        window.localStorage.setItem(\'console_log_capture\', JSON.stringify(messages));\n      }\n    </script>\n'
            )
        __M_writer(u'  <script type="text/javascript" src="')
        __M_writer(filters.decode.utf8(static.url(jsi18n_path)))
        __M_writer(u'"></script>\n  <script type="text/javascript" src="')
        __M_writer(filters.decode.utf8(static.url(ie11_fix_path)))
        __M_writer(
            u'"></script>\n\n  <link rel="icon" type="image/x-icon" href="')
        __M_writer(
            filters.decode.utf8(
                static.url(
                    static.get_value('favicon_path', settings.FAVICON_PATH))))
        __M_writer(u'" />\n\n  ')

        def ccall(caller):
            def body():
                __M_writer = context.writer()
                return ''

            return [body]

        context.caller_stack.nextcaller = runtime.Namespace(
            'caller', context, callables=ccall(__M_caller))
        try:
            __M_writer(filters.decode.utf8(static.css(group=u'style-vendor')))
        finally:
            context.caller_stack.nextcaller = None
        __M_writer(u'\n')
        if '/' in self.attr.main_css:
            if get_language_bidi():
                __M_writer(u'      ')

                rtl_css_file = self.attr.main_css.replace('.css', '-rtl.css')

                __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 ['rtl_css_file']
                        if __M_key in __M_locals_builtin_stored
                    ]))
                __M_writer(u'\n      <link rel="stylesheet" href="')
                __M_writer(
                    filters.decode.utf8(unicode(static.url(rtl_css_file))))
                __M_writer(u'" type="text/css" media="all" />\n')
            else:
                __M_writer(u'      <link rel="stylesheet" href="')
                __M_writer(filters.decode.utf8(static.url(self.attr.main_css)))
                __M_writer(u'" type="text/css" media="all" />\n')
        else:
            __M_writer(u'    ')

            def ccall(caller):
                def body():
                    __M_writer = context.writer()
                    return ''

                return [body]

            context.caller_stack.nextcaller = runtime.Namespace(
                'caller', context, callables=ccall(__M_caller))
            try:
                __M_writer(
                    filters.decode.utf8(
                        static.css(group=(self.attr.main_css))))
            finally:
                context.caller_stack.nextcaller = None
            __M_writer(u'\n')
        __M_writer(u'\n')
        if disable_courseware_js or uses_pattern_library:
            __M_writer(u'    ')

            def ccall(caller):
                def body():
                    __M_writer = context.writer()
                    return ''

                return [body]

            context.caller_stack.nextcaller = runtime.Namespace(
                'caller', context, callables=ccall(__M_caller))
            try:
                __M_writer(filters.decode.utf8(
                    static.js(group=u'base_vendor')))
            finally:
                context.caller_stack.nextcaller = None
            __M_writer(u'\n    ')

            def ccall(caller):
                def body():
                    __M_writer = context.writer()
                    return ''

                return [body]

            context.caller_stack.nextcaller = runtime.Namespace(
                'caller', context, callables=ccall(__M_caller))
            try:
                __M_writer(
                    filters.decode.utf8(static.js(group=u'base_application')))
            finally:
                context.caller_stack.nextcaller = None
            __M_writer(u'\n')
        else:
            __M_writer(u'    ')

            def ccall(caller):
                def body():
                    __M_writer = context.writer()
                    return ''

                return [body]

            context.caller_stack.nextcaller = runtime.Namespace(
                'caller', context, callables=ccall(__M_caller))
            try:
                __M_writer(filters.decode.utf8(
                    static.js(group=u'main_vendor')))
            finally:
                context.caller_stack.nextcaller = None
            __M_writer(u'\n    ')

            def ccall(caller):
                def body():
                    __M_writer = context.writer()
                    return ''

                return [body]

            context.caller_stack.nextcaller = runtime.Namespace(
                'caller', context, callables=ccall(__M_caller))
            try:
                __M_writer(filters.decode.utf8(
                    static.js(group=u'application')))
            finally:
                context.caller_stack.nextcaller = None
            __M_writer(u'\n')
        __M_writer(u'\n  ')

        def ccall(caller):
            def body():
                __M_writer = context.writer()
                return ''

            return [body]

        context.caller_stack.nextcaller = runtime.Namespace(
            'caller', context, callables=ccall(__M_caller))
        try:
            __M_writer(filters.decode.utf8(static.webpack(entry=u'commons')))
        finally:
            context.caller_stack.nextcaller = None
        __M_writer(u'\n\n')
        if uses_bootstrap:
            __M_writer(u'    <script type="text/javascript" src="')
            __M_writer(
                filters.decode.utf8(
                    static.url('common/js/vendor/bootstrap.bundle.js')))
            __M_writer(u'"></script>\n')
        __M_writer(u'\n  <script>\n    window.baseUrl = "')
        __M_writer(js_escaped_string(settings.STATIC_URL))
        __M_writer(
            u'";\n    (function (require) {\n      require.config({\n          baseUrl: window.baseUrl\n      });\n    }).call(this, require || RequireJS.require);\n  </script>\n  <script type="text/javascript" src="'
        )
        __M_writer(filters.decode.utf8(static.url("lms/js/require-config.js")))
        __M_writer(u'"></script>\n  ')
        if 'parent' not in context._data or not hasattr(
                context._data['parent'], 'js_overrides'):
            context['self'].js_overrides(**pageargs)

        __M_writer(u'\n\n  ')
        if 'parent' not in context._data or not hasattr(
                context._data['parent'], 'headextra'):
            context['self'].headextra(**pageargs)

        __M_writer(u'\n  ')
        if 'parent' not in context._data or not hasattr(
                context._data['parent'], 'head_extra'):
            context['self'].head_extra(**pageargs)

        __M_writer(u'\n\n  ')
        runtime._include_file(context, u'/courseware/experiments.html',
                              _template_uri)
        __M_writer(u'\n  ')
        runtime._include_file(context, u'user_metadata.html', _template_uri)
        __M_writer(u'\n  ')

        def ccall(caller):
            def body():
                __M_writer = context.writer()
                return ''

            return [body]

        context.caller_stack.nextcaller = runtime.Namespace(
            'caller', context, callables=ccall(__M_caller))
        try:
            __M_writer(
                filters.decode.utf8(
                    static.optional_include_mako(is_theming_enabled=u'True',
                                                 file=u'head-extra.html')))
        finally:
            context.caller_stack.nextcaller = None
        __M_writer(u'\n\n  ')
        runtime._include_file(context, u'widgets/optimizely.html',
                              _template_uri)
        __M_writer(u'\n  ')
        runtime._include_file(context, u'widgets/segment-io.html',
                              _template_uri)
        __M_writer(u'\n\n  <meta name="path_prefix" content="')
        __M_writer(filters.decode.utf8(EDX_ROOT_URL))
        __M_writer(u'">\n  \n  ')
        google_site_verification_id = configuration_helpers.get_value(
            'GOOGLE_SITE_VERIFICATION_ID',
            settings.GOOGLE_SITE_VERIFICATION_ID)

        __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 ['google_site_verification_id']
                              if __M_key in __M_locals_builtin_stored]))
        __M_writer(u'\n')
        if google_site_verification_id:
            __M_writer(u'    <meta name="google-site-verification" content="')
            __M_writer(filters.decode.utf8(google_site_verification_id))
            __M_writer(u'" />\n')
        __M_writer(u'\n  <meta name="openedx-release-line" content="')
        __M_writer(filters.decode.utf8(RELEASE_LINE))
        __M_writer(u'" />\n\n')
        ga_acct = static.get_value("GOOGLE_ANALYTICS_ACCOUNT",
                                   settings.GOOGLE_ANALYTICS_ACCOUNT)

        __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 ['ga_acct']
                              if __M_key in __M_locals_builtin_stored]))
        __M_writer(u'\n')
        if ga_acct:
            __M_writer(
                u'    <script type="text/javascript">\n    var _gaq = _gaq || [];\n    _gaq.push([\'_setAccount\', \''
            )
            __M_writer(js_escaped_string(ga_acct))
            __M_writer(
                u"']);\n    _gaq.push(['_trackPageview']);\n\n    (function() {\n      var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\n      ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\n      var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\n    })();\n    </script>\n"
            )
        __M_writer(u'\n')
        branch_key = static.get_value("BRANCH_IO_KEY", settings.BRANCH_IO_KEY)

        __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 ['branch_key']
                              if __M_key in __M_locals_builtin_stored]))
        __M_writer(u'\n')
        if branch_key and not is_from_mobile_app:
            __M_writer(
                u'    <script type="text/javascript">\n        (function(b,r,a,n,c,h,_,s,d,k){if(!b[n]||!b[n]._q){for(;s<_.length;)c(h,_[s++]);d=r.createElement(a);d.async=1;d.src="https://cdn.branch.io/branch-latest.min.js";k=r.getElementsByTagName(a)[0];k.parentNode.insertBefore(d,k);b[n]=h}})(window,document,"script","branch",function(b,r){b[r]=function(){b._q.push([r,arguments])}},{_q:[],_v:1},"addListener applyCode banner closeBanner creditHistory credits data deepview deepviewCta first getCode init link logout redeem referrals removeListener sendSMS setBranchViewData setIdentity track validateCode".split(" "), 0);\n        branch.init(\''
            )
            __M_writer(js_escaped_string(branch_key))
            __M_writer(u"');\n    </script>\n")
        __M_writer(u'\n</head>\n\n<body class="')
        __M_writer(filters.decode.utf8(static.dir_rtl()))
        __M_writer(u' ')
        if 'parent' not in context._data or not hasattr(
                context._data['parent'], 'bodyclass'):
            context['self'].bodyclass(**pageargs)

        __M_writer(u' lang_')
        __M_writer(filters.decode.utf8(LANGUAGE_CODE))
        __M_writer(u'">\n\n')

        def ccall(caller):
            def body():
                __M_writer = context.writer()
                return ''

            return [body]

        context.caller_stack.nextcaller = runtime.Namespace(
            'caller', context, callables=ccall(__M_caller))
        try:
            __M_writer(
                filters.decode.utf8(
                    static.optional_include_mako(is_theming_enabled=u'True',
                                                 file=u'body-initial.html')))
        finally:
            context.caller_stack.nextcaller = None
        __M_writer(u'\n<div id="page-prompt"></div>\n')
        if not disable_window_wrap:
            __M_writer(u'  <div class="window-wrap" dir="')
            __M_writer(filters.decode.utf8(static.dir_rtl()))
            __M_writer(u'">\n')
        __M_writer(
            u'    <a class="nav-skip sr-only sr-only-focusable" href="#main">')
        __M_writer(filters.decode.utf8(_("Skip to main content")))
        __M_writer(u'</a>\n\n')
        if not disable_header:
            __M_writer(u'        ')
            runtime._include_file(context,
                                  (static.get_template_path('header.html')),
                                  _template_uri,
                                  online_help_token=online_help_token)
            __M_writer(u'\n        ')
            runtime._include_file(context, u'/preview_menu.html',
                                  _template_uri)
            __M_writer(u'\n')
        __M_writer(u'\n    ')
        runtime._include_file(context, u'/page_banner.html', _template_uri)
        __M_writer(u'\n\n    <div class="marketing-hero">')
        if 'parent' not in context._data or not hasattr(
                context._data['parent'], 'marketing_hero'):
            context['self'].marketing_hero(**pageargs)

        __M_writer(
            u'</div>\n\n    <div class="content-wrapper main-container" id="content" dir="'
        )
        __M_writer(filters.decode.utf8(static.dir_rtl()))
        __M_writer(u'">\n      ')
        __M_writer(filters.decode.utf8(self.body()))
        __M_writer(u'\n      ')
        if 'parent' not in context._data or not hasattr(
                context._data['parent'], 'bodyextra'):
            context['self'].bodyextra(**pageargs)

        __M_writer(u'\n    </div>\n\n')
        if not disable_footer:
            __M_writer(u'        ')
            runtime._include_file(context,
                                  (static.get_template_path('footer.html')),
                                  _template_uri)
            __M_writer(u'\n')
        __M_writer(u'\n')
        if not disable_window_wrap:
            __M_writer(u'  </div>\n')
        __M_writer(u'\n  ')
        if 'parent' not in context._data or not hasattr(
                context._data['parent'], 'footer_extra'):
            context['self'].footer_extra(**pageargs)

        __M_writer(u'\n  ')
        if 'parent' not in context._data or not hasattr(
                context._data['parent'], 'js_extra'):
            context['self'].js_extra(**pageargs)

        __M_writer(u'\n\n  ')
        runtime._include_file(context, u'widgets/segment-io-footer.html',
                              _template_uri)
        __M_writer(u'\n  <script type="text/javascript" src="')
        __M_writer(filters.decode.utf8(static.url('js/vendor/noreferrer.js')))
        __M_writer(
            u'" charset="utf-8"></script>\n  <script type="text/javascript" src="'
        )
        __M_writer(filters.decode.utf8(static.url('js/utils/navigation.js')))
        __M_writer(
            u'" charset="utf-8"></script>\n  <script type="text/javascript" src="'
        )
        __M_writer(filters.decode.utf8(static.url('js/header/header.js')))
        __M_writer(u'"></script>\n  ')

        def ccall(caller):
            def body():
                __M_writer = context.writer()
                return ''

            return [body]

        context.caller_stack.nextcaller = runtime.Namespace(
            'caller', context, callables=ccall(__M_caller))
        try:
            __M_writer(
                filters.decode.utf8(
                    static.optional_include_mako(is_theming_enabled=u'True',
                                                 file=u'body-extra.html')))
        finally:
            context.caller_stack.nextcaller = None
        __M_writer(u'\n</body>\n</html>\n\n')
        __M_writer(u'\n')
        return ''
    finally:
        context.caller_stack._pop_frame()
예제 #16
0
파일: footer.html.py 프로젝트: lxp20201/lxp
def render_body(context, **pageargs):
    __M_caller = context.caller_stack._push_frame()
    try:
        __M_locals = __M_dict_builtin(pageargs=pageargs)
        include_dependencies = context.get('include_dependencies', UNDEFINED)
        is_secure = context.get('is_secure', UNDEFINED)
        static = _mako_get_namespace(context, 'static')
        bidi = context.get('bidi', UNDEFINED)
        footer_css_urls = context.get('footer_css_urls', UNDEFINED)
        __M_writer = context.writer()
        __M_writer(u'\n')
        __M_writer(u'\n')
        footer = get_footer(is_secure=is_secure)

        __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 ['footer']
                              if __M_key in __M_locals_builtin_stored]))
        __M_writer(u'\n')
        __M_writer(
            u'\n\n<div class="wrapper wrapper-footer">\n\n  <div class="footer_section footer_section-contact-us">\n    <div class="footer_section-holder">\n      <span class="footer_text">If you have some questions please contact us</span>\n      <a class="footer_btn__contact" href="/contact">Contact us</a>\n    </div>\n  </div>\n\n  <footer id="footer-openedx" class="grid-container"\n'
        )
        if bidi:
            __M_writer(u'      dir=')
            __M_writer(filters.html_escape(filters.decode.utf8(bidi)))
            __M_writer(u'\n')
        __M_writer(
            u'  >\n    <div class="colophon">\n      <div class="footer-nav-wrapper">\n        <div class="footer-col">\n          <div class="footer-title">About the CintanaTech</div>\n          <ul>\n            <li><a href="https://cintanatech.com/" target="_blank">CintanaTech</a></li>\n            <li><a href="https://cintanatech.com/" target="_blank">About Us</a></li>\n            <li><a href="https://cintanatech.com/" target="_blank">eDX Services</a></li>\n            <li><a href="https://cintanatech.com/" target="_blank">Blog</a></li>\n          </ul>\n        </div>\n\n        <div class="footer-col">\n          <div class="footer-title">courses</div>\n          <ul>\n            <li><a href="https://cintanatech.com/" target="_blank">Create Course Now</a></li>\n            <li><a href="https://cintanatech.com/en/about-us/" target="_blank">About Us</a></li>\n            <li><a href="https://cintanatech.com/#our_services" target="_blank">eDX Services</a></li>\n            <li><a href="https://cintanatech.com/en/blog/" target="_blank">Blog</a></li>\n          </ul>\n        </div>\n\n        <div class="footer-col">\n          <div class="footer-title">Contact us</div>\n          <ul>\n            <li><a href="/contact">Contact Us</a></li>\n            <li><a href="https://cintanatech.com/" target="_blank">Help</a></li>\n          </ul>\n        </div>\n      </div>\n\n      <div class="footer_section">\n        <div class="footer_copyright-holder">\n          \xa9 2020 CintanaTech. All Rights Reserved\n          <a href="'
        )
        __M_writer(
            filters.html_escape(
                filters.decode.utf8(footer['openedx_link']['url'])))
        __M_writer(u'">\n            <img src="')
        __M_writer(
            filters.html_escape(
                filters.decode.utf8(footer['openedx_link']['image'])))
        __M_writer(u'" alt="')
        __M_writer(
            filters.html_escape(
                filters.decode.utf8(footer['openedx_link']['title'])))
        __M_writer(
            u'" width="140" />\n          </a>\n        </div>\n      </div>\n\n    </div>\n  </footer>\n</div>\n'
        )
        if include_dependencies:
            __M_writer(u'  ')

            def ccall(caller):
                def body():
                    __M_writer = context.writer()
                    return ''

                return [body]

            context.caller_stack.nextcaller = runtime.Namespace(
                'caller', context, callables=ccall(__M_caller))
            try:
                __M_writer(
                    filters.html_escape(
                        filters.decode.utf8(static.js(group=u'base_vendor'))))
            finally:
                context.caller_stack.nextcaller = None
            __M_writer(u'\n  ')

            def ccall(caller):
                def body():
                    __M_writer = context.writer()
                    return ''

                return [body]

            context.caller_stack.nextcaller = runtime.Namespace(
                'caller', context, callables=ccall(__M_caller))
            try:
                __M_writer(
                    filters.html_escape(
                        filters.decode.utf8(
                            static.css(group=u'style-vendor'))))
            finally:
                context.caller_stack.nextcaller = None
            __M_writer(u'\n  ')
            runtime._include_file(context, u'widgets/segment-io.html',
                                  _template_uri)
            __M_writer(u'\n  ')
            runtime._include_file(context, u'widgets/segment-io-footer.html',
                                  _template_uri)
            __M_writer(u'\n')
        if footer_css_urls:
            for url in footer_css_urls:
                __M_writer(
                    u'    <link rel="stylesheet" type="text/css" href="')
                __M_writer(filters.html_escape(filters.decode.utf8(url)))
                __M_writer(u'"></link>\n')
        return ''
    finally:
        context.caller_stack._pop_frame()
예제 #17
0
def render_body(context, active_page=None, **pageargs):
    __M_caller = context.caller_stack._push_frame()
    try:
        __M_locals = __M_dict_builtin(pageargs=pageargs,
                                      active_page=active_page)
        masquerade = context.get('masquerade', UNDEFINED)
        supports_preview_menu = context.get('supports_preview_menu', UNDEFINED)
        course = context.get('course', UNDEFINED)
        static = _mako_get_namespace(context, 'static')
        sorted = context.get('sorted', UNDEFINED)
        disable_student_access = context.get('disable_student_access',
                                             UNDEFINED)
        staff_access = context.get('staff_access', UNDEFINED)
        __M_writer = context.writer()
        __M_writer(u'\n')
        __M_writer(u'\n')
        __M_writer(u'\n')
        __M_writer(u'\n\n')

        show_preview_menu = course and staff_access and supports_preview_menu

        __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 ['show_preview_menu']
                              if __M_key in __M_locals_builtin_stored]))
        __M_writer(u'\n\n')
        if show_preview_menu:
            __M_writer(u'    ')

            def selected(is_selected):
                return "selected" if is_selected else ""

            course_partitions = get_all_partitions_for_course(course)
            masquerade_user_name = masquerade.user_name if masquerade else None
            masquerade_group_id = masquerade.group_id if masquerade else None
            masquerade_user_partition_id = masquerade.user_partition_id if masquerade else None
            staff_selected = selected(not masquerade
                                      or masquerade.role != "student")
            specific_student_selected = selected(not staff_selected
                                                 and masquerade.user_name)
            student_selected = selected(not staff_selected
                                        and not specific_student_selected
                                        and not masquerade_group_id)

            __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 [
                        'masquerade_user_name', 'selected',
                        'specific_student_selected', 'course_partitions',
                        'staff_selected', 'masquerade_user_partition_id',
                        'masquerade_group_id', 'student_selected'
                    ] if __M_key in __M_locals_builtin_stored
                ]))
            __M_writer(u'\n    <nav class="wrapper-preview-menu" aria-label="')
            __M_writer(
                filters.html_escape(filters.decode.utf8(_('Course View'))))
            __M_writer(
                u'">\n        <div class="preview-menu">\n            <ol class="preview-actions">\n                <li class="action-preview">\n                    <form action="#" class="action-preview-form" method="post">\n                        <label for="action-preview-select" class="action-preview-label">'
            )
            __M_writer(
                filters.html_escape(
                    filters.decode.utf8(_("View this course as:"))))
            __M_writer(
                u'</label>\n                        <select class="action-preview-select" id="action-preview-select" name="select">\n                            <option value="staff" '
            )
            __M_writer(filters.html_escape(
                filters.decode.utf8(staff_selected)))
            __M_writer(u'>')
            __M_writer(filters.html_escape(filters.decode.utf8(_("Staff"))))
            __M_writer(
                u'</option>\n                            <option value="student" '
            )
            __M_writer(
                filters.html_escape(filters.decode.utf8(student_selected)))
            __M_writer(u'>')
            __M_writer(filters.html_escape(filters.decode.utf8(_("Learner"))))
            __M_writer(
                u'</option>\n                            <option value="specific student" '
            )
            __M_writer(
                filters.html_escape(
                    filters.decode.utf8(specific_student_selected)))
            __M_writer(u'>')
            __M_writer(
                filters.html_escape(filters.decode.utf8(
                    _("Specific learner"))))
            __M_writer(u'</option>\n')
            if course_partitions:
                for course_partition in course_partitions:
                    for group in sorted(course_partition.groups,
                                        key=lambda group: group.name):
                        __M_writer(
                            u'                                    <option value="group.id" data-group-id="'
                        )
                        __M_writer(
                            filters.html_escape(filters.decode.utf8(group.id)))
                        __M_writer(u'" data-partition-id="')
                        __M_writer(
                            filters.html_escape(
                                filters.decode.utf8(course_partition.id)))
                        __M_writer(u'" ')
                        __M_writer(
                            filters.html_escape(
                                filters.decode.utf8(
                                    selected(
                                        masquerade_user_partition_id
                                        == course_partition.id
                                        and masquerade_group_id == group.id))))
                        __M_writer(
                            u'>\n                                        ')
                        __M_writer(
                            filters.html_escape(
                                filters.decode.utf8(
                                    _("Learner in {content_group}").format(
                                        content_group=group.name))))
                        __M_writer(
                            u'\n                                    </option>\n'
                        )
            __M_writer(
                u'                        </select>\n                        <div class="action-preview-username-container">\n                          <label for="action-preview-username" class="action-preview-label">'
            )
            __M_writer(
                filters.html_escape(
                    filters.decode.utf8(_("Username or email:"))))
            __M_writer(
                u'</label>\n                          <input type="text" class="action-preview-username" id="action-preview-username">\n                        </div>\n                        <button type="submit" class="sr-only" name="submit" value="submit">'
            )
            __M_writer(
                filters.html_escape(filters.decode.utf8(
                    _("Set preview mode"))))
            __M_writer(
                u'</button>\n                    </form>\n                </li>\n            </ol>\n'
            )
            if specific_student_selected:
                __M_writer(
                    u'                <div class="preview-specific-student-notice">\n                    <p>\n                        '
                )
                __M_writer(
                    filters.html_escape(
                        filters.decode.utf8(
                            Text(
                                _("You are now viewing the course as {i_start}{user_name}{i_end}."
                                  )).format(
                                      user_name=masquerade_user_name,
                                      i_start=HTML(u'<i>'),
                                      i_end=HTML(u'</i>'),
                                  ))))
                __M_writer(
                    u'\n                    </p>\n                </div>\n')
            __M_writer(u'        </div>\n    </nav>\n\n    ')

            preview_options = {
                "courseId":
                course.id,
                "disableStudentAccess":
                disable_student_access
                if disable_student_access is not UNDEFINED else False,
                "specificStudentSelected":
                specific_student_selected,
                "masqueradeUsername":
                masquerade_user_name
                if masquerade_user_name is not UNDEFINED else None,
            }

            __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 ['preview_options']
                                  if __M_key in __M_locals_builtin_stored]))
            __M_writer(u'\n    ')

            def ccall(caller):
                def body():
                    __M_writer = context.writer()
                    __M_writer(u'\n        PreviewFactory(')
                    __M_writer(dump_js_escaped_json(preview_options))
                    __M_writer(u');\n    ')
                    return ''

                return [body]

            context.caller_stack.nextcaller = runtime.Namespace(
                'caller', context, callables=ccall(__M_caller))
            try:
                __M_writer(
                    filters.html_escape(
                        filters.decode.utf8(
                            static.require_module_async(
                                class_name=u'PreviewFactory',
                                module_name=u'lms/js/preview/preview_factory'))
                    ))
            finally:
                context.caller_stack.nextcaller = None
            __M_writer(u'\n')
        return ''
    finally:
        context.caller_stack._pop_frame()
예제 #18
0
def render_body(context, **pageargs):
    __M_caller = context.caller_stack._push_frame()
    try:
        __M_locals = __M_dict_builtin(pageargs=pageargs)
        resume_course_url = context.get('resume_course_url', UNDEFINED)
        course_home_message_fragment = context.get(
            'course_home_message_fragment', UNDEFINED)
        upgrade_price = context.get('upgrade_price', UNDEFINED)
        upgrade_url = context.get('upgrade_url', UNDEFINED)
        has_goal_permission = context.get('has_goal_permission', UNDEFINED)
        update_message_fragment = context.get('update_message_fragment',
                                              UNDEFINED)
        course_tools = context.get('course_tools', UNDEFINED)
        handouts_html = context.get('handouts_html', UNDEFINED)
        course_key = context.get('course_key', UNDEFINED)

        def content():
            return render_content(context._locals(__M_locals))

        course = context.get('course', UNDEFINED)
        goal_options = context.get('goal_options', UNDEFINED)
        static = _mako_get_namespace(context, 'static')
        course_sock_fragment = context.get('course_sock_fragment', UNDEFINED)
        current_goal = context.get('current_goal', UNDEFINED)
        dates_fragment = context.get('dates_fragment', UNDEFINED)
        course_expiration_fragment = context.get('course_expiration_fragment',
                                                 UNDEFINED)
        has_visited_course = context.get('has_visited_course', UNDEFINED)

        def header_extras():
            return render_header_extras(context._locals(__M_locals))

        outline_fragment = context.get('outline_fragment', UNDEFINED)
        __M_writer = context.writer()
        __M_writer(u'\n')
        __M_writer(u'\n')
        __M_writer(u'\n\n')
        __M_writer(u'\n\n')
        if 'parent' not in context._data or not hasattr(
                context._data['parent'], 'header_extras'):
            context['self'].header_extras(**pageargs)

        __M_writer(u'\n\n')
        if 'parent' not in context._data or not hasattr(
                context._data['parent'], 'content'):
            context['self'].content(**pageargs)

        __M_writer(u'\n\n')

        def ccall(caller):
            def body():
                username = context.get('username', UNDEFINED)
                goal_api_url = context.get('goal_api_url', UNDEFINED)
                __M_writer = context.writer()
                __M_writer(u'\n    new CourseHome({\n        courseRunKey: "')
                __M_writer(js_escaped_string(course_key))
                __M_writer(
                    u'",\n        resumeCourseLink: ".action-resume-course",\n        courseToolLink: ".course-tool-link",\n        goalApiUrl: "'
                )
                __M_writer(js_escaped_string(goal_api_url))
                __M_writer(u'",\n        username: "******",\n        courseId: "')
                __M_writer(js_escaped_string(course.id))
                __M_writer(u'",\n    });\n')
                return ''

            return [body]

        context.caller_stack.nextcaller = runtime.Namespace(
            'caller', context, callables=ccall(__M_caller))
        try:
            __M_writer(
                filters.html_escape(
                    filters.decode.utf8(static.webpack(entry=u'CourseHome'))))
        finally:
            context.caller_stack.nextcaller = None
        __M_writer(u'\n\n')

        def ccall(caller):
            def body():
                __M_writer = context.writer()
                __M_writer(u"\n    new CourseEnrollment('.enroll-btn', '")
                __M_writer(js_escaped_string(course_key))
                __M_writer(u"');\n")
                return ''

            return [body]

        context.caller_stack.nextcaller = runtime.Namespace(
            'caller', context, callables=ccall(__M_caller))
        try:
            __M_writer(
                filters.html_escape(
                    filters.decode.utf8(static.webpack(entry=u'Enrollment'))))
        finally:
            context.caller_stack.nextcaller = None
        __M_writer(u'\n')
        return ''
    finally:
        context.caller_stack._pop_frame()
예제 #19
0
def render_body(context, **pageargs):
    __M_caller = context.caller_stack._push_frame()
    try:
        __M_locals = __M_dict_builtin(pageargs=pageargs)
        toc = context.get('toc', UNDEFINED)
        static = _mako_get_namespace(context, 'static')

        def make_chapter(chapter):
            return render_make_chapter(context._locals(__M_locals), chapter)

        __M_writer = context.writer()
        __M_writer(u'\n')
        __M_writer(u'\n')
        __M_writer(u'\n\n')
        __M_writer(u'\n\n')
        for chapter in toc:
            __M_writer(u'    ')
            __M_writer(
                filters.html_escape(filters.decode.utf8(
                    make_chapter(chapter))))
            __M_writer(u'\n')
        __M_writer(u'\n\n')
        if toc:
            __M_writer(u'    ')

            def ccall(caller):
                def body():
                    __M_writer = context.writer()
                    __M_writer(u'\n        AccordionEvents();\n    ')
                    return ''

                return [body]

            context.caller_stack.nextcaller = runtime.Namespace(
                'caller', context, callables=ccall(__M_caller))
            try:
                __M_writer(
                    filters.html_escape(
                        filters.decode.utf8(
                            static.require_module_async(
                                class_name=u'AccordionEvents',
                                module_name=u'js/courseware/accordion_events'))
                    ))
            finally:
                context.caller_stack.nextcaller = None
            __M_writer(u'\n\n    ')

            def ccall(caller):
                def body():
                    __M_writer = context.writer()
                    __M_writer(
                        u'\n        DateUtilFactory.transform(iterationKey=".localized-datetime");\n    '
                    )
                    return ''

                return [body]

            context.caller_stack.nextcaller = runtime.Namespace(
                'caller', context, callables=ccall(__M_caller))
            try:
                __M_writer(
                    filters.html_escape(
                        filters.decode.utf8(
                            static.require_module_async(
                                class_name=u'DateUtilFactory',
                                module_name=u'js/dateutil_factory'))))
            finally:
                context.caller_stack.nextcaller = None
            __M_writer(u'\n')
        return ''
    finally:
        context.caller_stack._pop_frame()
예제 #20
0
def render_body(context, **pageargs):
    __M_caller = context.caller_stack._push_frame()
    try:
        __M_locals = __M_dict_builtin(pageargs=pageargs)

        def requirejs():
            return render_requirejs(context._locals(__M_locals))

        request = context.get('request', UNDEFINED)
        EDX_ROOT_URL = context.get('EDX_ROOT_URL', UNDEFINED)
        static = _mako_get_namespace(context, 'static')
        LANGUAGE_CODE = context.get('LANGUAGE_CODE', UNDEFINED)

        def bodyclass():
            return render_bodyclass(context._locals(__M_locals))

        def title():
            return render_title(context._locals(__M_locals))

        context_library = context.get('context_library', UNDEFINED)

        def jsextra():
            return render_jsextra(context._locals(__M_locals))

        def content():
            return render_content(context._locals(__M_locals))

        getattr = context.get('getattr', UNDEFINED)
        uses_bootstrap = context.get('uses_bootstrap', UNDEFINED)

        def view_notes():
            return render_view_notes(context._locals(__M_locals))

        user = context.get('user', UNDEFINED)
        hasattr = context.get('hasattr', UNDEFINED)
        context_course = context.get('context_course', UNDEFINED)
        settings = context.get('settings', UNDEFINED)
        list = context.get('list', UNDEFINED)

        def page_bundle():
            return render_page_bundle(context._locals(__M_locals))

        def page_alert():
            return render_page_alert(context._locals(__M_locals))

        def header_extras():
            return render_header_extras(context._locals(__M_locals))

        def modal_placeholder():
            return render_modal_placeholder(context._locals(__M_locals))

        self = context.get('self', UNDEFINED)
        __M_writer = context.writer()
        __M_writer(u'\n')
        __M_writer(u'\n\n')
        __M_writer(u'\n')
        __M_writer(u'\n\n')
        __M_writer(
            u'\n<!doctype html>\n<!--[if lte IE 9]><html class="ie9 lte9" lang="'
        )
        __M_writer(filters.html_escape(filters.decode.utf8(LANGUAGE_CODE)))
        __M_writer(u'"><![endif]-->\n<!--[if !IE]><<!--><html lang="')
        __M_writer(filters.html_escape(filters.decode.utf8(LANGUAGE_CODE)))
        __M_writer(u'"><!--<![endif]-->\n  <head dir="')
        __M_writer(filters.html_escape(filters.decode.utf8(static.dir_rtl())))
        __M_writer(
            u'">\n    <meta charset="utf-8">\n    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">\n    <meta name="openedx-release-line" content="'
        )
        __M_writer(filters.html_escape(filters.decode.utf8(RELEASE_LINE)))
        __M_writer(u'" />\n    <title>\n        ')
        if 'parent' not in context._data or not hasattr(
                context._data['parent'], 'title'):
            context['self'].title(**pageargs)

        __M_writer(u' |\n')
        if context_course:
            __M_writer(u'        ')
            ctx_loc = context_course.location

            __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 ['ctx_loc']
                                  if __M_key in __M_locals_builtin_stored]))
            __M_writer(u'\n        ')
            __M_writer(
                filters.html_escape(
                    filters.decode.utf8(
                        context_course.display_name_with_default)))
            __M_writer(u' |\n')
        elif context_library:
            __M_writer(u'        ')
            __M_writer(
                filters.html_escape(
                    filters.decode.utf8(
                        context_library.display_name_with_default)))
            __M_writer(u' |\n')
        __M_writer(u'        ')
        __M_writer(
            filters.html_escape(filters.decode.utf8(settings.STUDIO_NAME)))
        __M_writer(u'\n    </title>\n\n    ')

        jsi18n_path = "js/i18n/{language}/djangojs.js".format(
            language=LANGUAGE_CODE)

        __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 ['jsi18n_path']
                              if __M_key in __M_locals_builtin_stored]))
        __M_writer(u'\n\n')
        if getattr(settings, 'CAPTURE_CONSOLE_LOG', False):
            __M_writer(
                u'        <script type="text/javascript">\n            var oldOnError = window.onerror;\n            window.localStorage.setItem(\'console_log_capture\', JSON.stringify([]));\n\n            window.onerror = function (message, url, lineno, colno, error) {\n                if (oldOnError) {\n                    oldOnError.apply(this, arguments);\n                }\n\n                var messages = JSON.parse(window.localStorage.getItem(\'console_log_capture\'));\n                messages.push([message, url, lineno, colno, (error || {}).stack]);\n                window.localStorage.setItem(\'console_log_capture\', JSON.stringify(messages));\n            }\n        </script>\n'
            )
        __M_writer(u'\n    <script type="text/javascript" src="')
        __M_writer(
            filters.html_escape(filters.decode.utf8(static.url(jsi18n_path))))
        __M_writer(
            u'"></script>\n    <meta name="viewport" content="width=device-width,initial-scale=1">\n    <meta name="path_prefix" content="'
        )
        __M_writer(filters.html_escape(filters.decode.utf8(EDX_ROOT_URL)))
        __M_writer(u'">\n\n    ')

        def ccall(caller):
            def body():
                __M_writer = context.writer()
                return ''

            return [body]

        context.caller_stack.nextcaller = runtime.Namespace(
            'caller', context, callables=ccall(__M_caller))
        try:
            __M_writer(
                filters.html_escape(
                    filters.decode.utf8(static.css(group=u'style-vendor'))))
        finally:
            context.caller_stack.nextcaller = None
        __M_writer(u'\n    ')

        def ccall(caller):
            def body():
                __M_writer = context.writer()
                return ''

            return [body]

        context.caller_stack.nextcaller = runtime.Namespace(
            'caller', context, callables=ccall(__M_caller))
        try:
            __M_writer(
                filters.html_escape(
                    filters.decode.utf8(
                        static.css(group=u'style-vendor-tinymce-content'))))
        finally:
            context.caller_stack.nextcaller = None
        __M_writer(u'\n    ')

        def ccall(caller):
            def body():
                __M_writer = context.writer()
                return ''

            return [body]

        context.caller_stack.nextcaller = runtime.Namespace(
            'caller', context, callables=ccall(__M_caller))
        try:
            __M_writer(
                filters.html_escape(
                    filters.decode.utf8(
                        static.css(group=u'style-vendor-tinymce-skin'))))
        finally:
            context.caller_stack.nextcaller = None
        __M_writer(u'\n\n')
        if uses_bootstrap:
            __M_writer(u'      <link rel="stylesheet" href="')
            __M_writer(
                filters.html_escape(
                    filters.decode.utf8(static.url(self.attr.main_css))))
            __M_writer(u'" type="text/css" media="all" />\n')
        else:
            __M_writer(u'      ')

            def ccall(caller):
                def body():
                    __M_writer = context.writer()
                    return ''

                return [body]

            context.caller_stack.nextcaller = runtime.Namespace(
                'caller', context, callables=ccall(__M_caller))
            try:
                __M_writer(
                    filters.html_escape(
                        filters.decode.utf8(
                            static.css(group=(self.attr.main_css)))))
            finally:
                context.caller_stack.nextcaller = None
            __M_writer(u'\n')
        __M_writer(u'\n    ')
        runtime._include_file(context, u'widgets/segment-io.html',
                              _template_uri)
        __M_writer(u'\n\n    ')
        if 'parent' not in context._data or not hasattr(
                context._data['parent'], 'header_extras'):
            context['self'].header_extras(**pageargs)

        __M_writer(u'\n  </head>\n\n  <body class="')
        __M_writer(filters.html_escape(filters.decode.utf8(static.dir_rtl())))
        __M_writer(u' ')
        if 'parent' not in context._data or not hasattr(
                context._data['parent'], 'bodyclass'):
            context['self'].bodyclass(**pageargs)

        __M_writer(u' lang_')
        __M_writer(filters.html_escape(filters.decode.utf8(LANGUAGE_CODE)))
        __M_writer(u'">\n    ')
        if 'parent' not in context._data or not hasattr(
                context._data['parent'], 'view_notes'):
            context['self'].view_notes(**pageargs)

        __M_writer(u'\n\n    <a class="nav-skip" href="#main">')
        __M_writer(
            filters.html_escape(filters.decode.utf8(
                _("Skip to main content"))))
        __M_writer(u'</a>\n\n    ')

        def ccall(caller):
            def body():
                __M_writer = context.writer()
                return ''

            return [body]

        context.caller_stack.nextcaller = runtime.Namespace(
            'caller', context, callables=ccall(__M_caller))
        try:
            __M_writer(
                filters.html_escape(
                    filters.decode.utf8(static.js(group=u'base_vendor'))))
        finally:
            context.caller_stack.nextcaller = None
        __M_writer(u'\n\n    ')

        def ccall(caller):
            def body():
                __M_writer = context.writer()
                return ''

            return [body]

        context.caller_stack.nextcaller = runtime.Namespace(
            'caller', context, callables=ccall(__M_caller))
        try:
            __M_writer(
                filters.html_escape(
                    filters.decode.utf8(static.webpack(entry=u'commons'))))
        finally:
            context.caller_stack.nextcaller = None
        __M_writer(
            u'\n\n    <script type="text/javascript">\n      window.baseUrl = "'
        )
        __M_writer(js_escaped_string(settings.STATIC_URL))
        __M_writer(
            u'";\n      require.config({\n          baseUrl: window.baseUrl\n      });\n    </script>\n\n    <script type="text/javascript" src="'
        )
        __M_writer(
            filters.html_escape(
                filters.decode.utf8(static.url("cms/js/require-config.js"))))
        __M_writer(
            u'"></script>\n\n    <!-- view -->\n    <div class="wrapper wrapper-view" dir="'
        )
        __M_writer(filters.html_escape(filters.decode.utf8(static.dir_rtl())))
        __M_writer(u'">\n      ')
        online_help_token = self.online_help_token() if hasattr(
            self, 'online_help_token') else None

        __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 ['online_help_token']
                              if __M_key in __M_locals_builtin_stored]))
        __M_writer(u'\n      ')
        runtime._include_file(context,
                              u'widgets/header.html',
                              _template_uri,
                              online_help_token=online_help_token)
        __M_writer(u'\n\n      ')

        banner_messages = list(PageLevelMessages.user_messages(request))

        __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 ['banner_messages']
                              if __M_key in __M_locals_builtin_stored]))
        __M_writer(u'\n\n')
        if banner_messages:
            __M_writer(
                u'        <div class="page-banner">\n          <div class="user-messages">\n'
            )
            for message in banner_messages:
                __M_writer(u'              <div class="alert ')
                __M_writer(
                    filters.html_escape(filters.decode.utf8(
                        message.css_class)))
                __M_writer(
                    u'" role="alert">\n                <span class="icon icon-alert fa '
                )
                __M_writer(
                    filters.html_escape(filters.decode.utf8(
                        message.icon_class)))
                __M_writer(u'" aria-hidden="true"></span>\n                ')
                __M_writer(
                    filters.html_escape(
                        filters.decode.utf8(HTML(message.message_html))))
                __M_writer(u'\n              </div>\n')
            __M_writer(u'          </div>\n        </div>\n')
        __M_writer(u'\n      <div id="page-alert">\n      ')
        if 'parent' not in context._data or not hasattr(
                context._data['parent'], 'page_alert'):
            context['self'].page_alert(**pageargs)

        __M_writer(
            u'\n      </div>\n\n      <main id="main" aria-label="Content" tabindex="-1">\n        <div id="content">\n        '
        )
        if 'parent' not in context._data or not hasattr(
                context._data['parent'], 'content'):
            context['self'].content(**pageargs)

        __M_writer(u'\n        </div>\n      </main>\n\n')
        if user.is_authenticated:
            __M_writer(u'        ')
            runtime._include_file(context,
                                  u'widgets/sock.html',
                                  _template_uri,
                                  online_help_token=online_help_token)
            __M_writer(u'\n')
        __M_writer(u'      ')
        runtime._include_file(context, u'widgets/footer.html', _template_uri)
        __M_writer(
            u'\n\n      <div id="page-notification"></div>\n    </div>\n\n    <div id="page-prompt"></div>\n\n    '
        )
        if 'parent' not in context._data or not hasattr(
                context._data['parent'], 'modal_placeholder'):
            context['self'].modal_placeholder(**pageargs)

        __M_writer(u'\n\n    ')
        if 'parent' not in context._data or not hasattr(
                context._data['parent'], 'jsextra'):
            context['self'].jsextra(**pageargs)

        __M_writer(u'\n\n')
        if context_course:
            __M_writer(u'      ')

            def ccall(caller):
                def body():
                    __M_writer = context.writer()
                    return ''

                return [body]

            context.caller_stack.nextcaller = runtime.Namespace(
                'caller', context, callables=ccall(__M_caller))
            try:
                __M_writer(
                    filters.html_escape(
                        filters.decode.utf8(
                            static.webpack(
                                entry=u'js/factories/context_course'))))
            finally:
                context.caller_stack.nextcaller = None
            __M_writer(
                u'\n      <script type="text/javascript">\n        window.course = new ContextCourse({\n          id: "'
            )
            __M_writer(js_escaped_string(context_course.id))
            __M_writer(u'",\n          name: "')
            __M_writer(
                js_escaped_string(context_course.display_name_with_default))
            __M_writer(u'",\n          url_name: "')
            __M_writer(js_escaped_string(context_course.location.block_id))
            __M_writer(u'",\n          org: "')
            __M_writer(js_escaped_string(context_course.location.org))
            __M_writer(u'",\n          num: "')
            __M_writer(js_escaped_string(context_course.location.course))
            __M_writer(u'",\n          display_course_number: "')
            __M_writer(js_escaped_string(context_course.display_coursenumber))
            __M_writer(u'",\n          revision: "')
            __M_writer(js_escaped_string(context_course.location.branch))
            __M_writer(u'",\n          self_paced: ')
            __M_writer(dump_js_escaped_json(context_course.self_paced))
            __M_writer(u'\n        });\n      </script>\n')
        if user.is_authenticated:
            __M_writer(u'      ')

            def ccall(caller):
                def body():
                    __M_writer = context.writer()
                    return ''

                return [body]

            context.caller_stack.nextcaller = runtime.Namespace(
                'caller', context, callables=ccall(__M_caller))
            try:
                __M_writer(
                    filters.html_escape(
                        filters.decode.utf8(static.webpack(entry=u'js/sock'))))
            finally:
                context.caller_stack.nextcaller = None
            __M_writer(u'\n')
        __M_writer(u'    ')
        if 'parent' not in context._data or not hasattr(
                context._data['parent'], 'page_bundle'):
            context['self'].page_bundle(**pageargs)

        __M_writer(u'\n    ')
        runtime._include_file(context, u'widgets/segment-io-footer.html',
                              _template_uri)
        __M_writer(
            u'\n    <div class="modal-cover"></div>\n  </body>\n</html>\n')
        return ''
    finally:
        context.caller_stack._pop_frame()
예제 #21
0
def _mako_generate_namespaces(context):
    # SOURCE LINE 2
    ns = runtime.Namespace(u'helper', context._clean_inheritance_tokens(), templateuri=u'/helper.mako', callables=None, calling_uri=_template_uri, module=None)
    context.namespaces[(__name__, u'helper')] = ns
예제 #22
0
def render_body(context,**pageargs):
    __M_caller = context.caller_stack._push_frame()
    try:
        __M_locals = __M_dict_builtin(pageargs=pageargs)
        loop = __M_loop = runtime.LoopStack()
        def certificate_block():
            return render_certificate_block(context._locals(__M_locals))
        int = context.get('int', UNDEFINED)
        float = context.get('float', UNDEFINED)
        def pagetitle():
            return render_pagetitle(context._locals(__M_locals))
        course = context.get('course', UNDEFINED)
        static = _mako_get_namespace(context, 'static')
        unicode = context.get('unicode', UNDEFINED)
        def bodyclass():
            return render_bodyclass(context._locals(__M_locals))
        credit_course_requirements = context.get('credit_course_requirements', UNDEFINED)
        def js_extra():
            return render_js_extra(context._locals(__M_locals))
        studio_url = context.get('studio_url', UNDEFINED)
        getattr = context.get('getattr', UNDEFINED)
        dict = context.get('dict', UNDEFINED)
        course_expiration_fragment = context.get('course_expiration_fragment', UNDEFINED)
        user_timezone = context.get('user_timezone', UNDEFINED)
        len = context.get('len', UNDEFINED)
        student = context.get('student', UNDEFINED)
        user_language = context.get('user_language', UNDEFINED)
        staff_access = context.get('staff_access', UNDEFINED)
        certificate_data = context.get('certificate_data', UNDEFINED)
        progress_graph = _mako_get_namespace(context, 'progress_graph')
        request = context.get('request', UNDEFINED)
        grade_summary = context.get('grade_summary', UNDEFINED)
        def headextra():
            return render_headextra(context._locals(__M_locals))
        courseware_summary = context.get('courseware_summary', UNDEFINED)
        __M_writer = context.writer()
        __M_writer(u'\n')
        __M_writer(u'\n')
        __M_writer(u'\n')
        __M_writer(u'\n')
        __M_writer(u'\n\n')

        username = get_enterprise_learner_generic_name(request) or student.username
        
        
        __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 ['username'] if __M_key in __M_locals_builtin_stored]))
        __M_writer(u'\n\n')
        if 'parent' not in context._data or not hasattr(context._data['parent'], 'bodyclass'):
            context['self'].bodyclass(**pageargs)
        

        __M_writer(u'\n\n')
        if 'parent' not in context._data or not hasattr(context._data['parent'], 'headextra'):
            context['self'].headextra(**pageargs)
        

        __M_writer(u'\n\n\n')
        __M_writer(u'\n\n')
        if 'parent' not in context._data or not hasattr(context._data['parent'], 'pagetitle'):
            context['self'].pagetitle(**pageargs)
        

        __M_writer(u'\n\n')
        if 'parent' not in context._data or not hasattr(context._data['parent'], 'js_extra'):
            context['self'].js_extra(**pageargs)
        

        __M_writer(u'\n\n')
        runtime._include_file(context, u'/courseware/course_navigation.html', _template_uri, active_page='progress')
        __M_writer(u'\n\n<main id="main" aria-label="Content" tabindex="-1">\n    <div class="container">\n        <div class="profile-wrapper">\n            <section class="course-info" id="course-info-progress"\n')
        if getattr(course, 'language'):
            __M_writer(u'                lang="')
            __M_writer(filters.html_escape(filters.decode.utf8(course.language)))
            __M_writer(u'"\n')
        __M_writer(u'              >\n')
        if staff_access and studio_url is not None:
            __M_writer(u'                <div class="wrap-instructor-info">\n                    <a class="instructor-info-action studio-view" href="')
            __M_writer(filters.html_escape(filters.decode.utf8(studio_url)))
            __M_writer(u'">')
            __M_writer(filters.html_escape(filters.decode.utf8(_("View Grading in studio"))))
            __M_writer(u'</a>\n                </div>\n')
        __M_writer(u'                <h2 class="hd hd-2 progress-certificates-title">\n                    ')
        __M_writer(filters.html_escape(filters.decode.utf8(_("Course Progress for Student '{username}' ({email})").format(username=username, email=student.email))))
        __M_writer(u'\n                </h2>\n')
        if course_expiration_fragment:
            __M_writer(u'                    ')
            __M_writer(filters.html_escape(filters.decode.utf8(HTML(course_expiration_fragment.content))))
            __M_writer(u'\n')
        __M_writer(u'                <div class="wrapper-msg wrapper-auto-cert">\n                    <div id="errors-info" class="errors-info"></div>\n                    ')
        if 'parent' not in context._data or not hasattr(context._data['parent'], 'certificate_block'):
            context['self'].certificate_block(**pageargs)
        

        __M_writer(u'\n                </div>\n\n')
        if not course.disable_progress_graph:
            __M_writer(u'                <div class="grade-detail-graph" id="grade-detail-graph"></div>\n')
        __M_writer(u'\n')
        if credit_course_requirements:
            __M_writer(u'                <section class="credit-eligibility">\n                    <h3 class="hd hd-4 eligibility-heading">')
            __M_writer(filters.html_escape(filters.decode.utf8(_("Requirements for Course Credit"))))
            __M_writer(u'</h3>\n                    <div class="credit-eligibility-container">\n')
            if credit_course_requirements['eligibility_status'] == 'not_eligible':
                __M_writer(u'                        <span class="eligibility_msg">')
                __M_writer(filters.html_escape(filters.decode.utf8(_("{student_name}, you are no longer eligible for credit in this course.").format(student_name=student.profile.name))))
                __M_writer(u'</span>\n')
            elif credit_course_requirements['eligibility_status'] == 'eligible':
                __M_writer(u'                        <span class="eligibility_msg">\n                            ')
                __M_writer(filters.html_escape(filters.decode.utf8(Text(_("{student_name}, you have met the requirements for credit in this course. {a_start}Go to your dashboard{a_end} to purchase course credit.")).format(
                                student_name=student.profile.name,
                                a_start=HTML("<a href={url}>").format(url=reverse('dashboard')),
                                a_end=HTML("</a>")
                            ))))
                __M_writer(u'\n                        </span>\n')
            elif credit_course_requirements['eligibility_status'] == 'partial_eligible':
                __M_writer(u'                        <span>')
                __M_writer(filters.html_escape(filters.decode.utf8(_("{student_name}, you have not yet met the requirements for credit.").format(student_name=student.profile.name))))
                __M_writer(u'</span>\n')
            __M_writer(u'\n                        <a href="')
            __M_writer(filters.html_escape(filters.decode.utf8(settings.CREDIT_HELP_LINK_URL)))
            __M_writer(u'" class="credit-help">\n                            <span class="fa fa-question" aria-hidden="true"></span>\n                            <span class="sr">')
            __M_writer(filters.html_escape(filters.decode.utf8(_("Information about course credit requirements"))))
            __M_writer(u'</span>\n                        </a><br />\n\n                        <div class="requirement-container" data-eligible="')
            __M_writer(filters.html_escape(filters.decode.utf8(credit_course_requirements['eligibility_status'])))
            __M_writer(u'">\n')
            for requirement in credit_course_requirements['requirements']:
                __M_writer(u'                            <div class="requirement">\n                                <div class="requirement-name">\n                                    ')
                __M_writer(filters.html_escape(filters.decode.utf8(_(requirement['display_name']))))
                __M_writer(u'\n')
                if requirement['namespace'] == 'grade':
                    __M_writer(u'                                    <span>')
                    __M_writer(filters.html_escape(filters.decode.utf8(int(requirement['criteria']['min_grade'] * 100))))
                    __M_writer(u'%</span>\n')
                __M_writer(u'                                </div>\n                                <div class="requirement-status">\n')
                if requirement['status']:
                    if requirement['status'] == 'submitted':
                        __M_writer(u'                                        <span class="requirement-submitted">')
                        __M_writer(filters.html_escape(filters.decode.utf8(_("Verification Submitted"))))
                        __M_writer(u'</span>\n')
                    elif requirement['status'] == 'failed':
                        __M_writer(u'                                        <span class="fa fa-times" aria-hidden="true"></span>\n                                        <span>')
                        __M_writer(filters.html_escape(filters.decode.utf8(_("Verification Failed" ))))
                        __M_writer(u'</span>\n')
                    elif requirement['status'] == 'declined':
                        __M_writer(u'                                        <span class="fa fa-times" aria-hidden="true"></span>\n                                        <span>')
                        __M_writer(filters.html_escape(filters.decode.utf8(_("Verification Declined" ))))
                        __M_writer(u'</span>\n')
                    elif requirement['status'] == 'satisfied':
                        __M_writer(u'                                        <span class="fa fa-check" aria-hidden="true"></span>\n                                        <span class="localized-datetime" data-datetime="')
                        __M_writer(filters.html_escape(filters.decode.utf8(requirement['status_date'])))
                        __M_writer(u'" data-string="')
                        __M_writer(filters.html_escape(filters.decode.utf8(_('Completed by {date}'))))
                        __M_writer(u'" data-timezone="')
                        __M_writer(filters.html_escape(filters.decode.utf8(user_timezone)))
                        __M_writer(u'" data-language="')
                        __M_writer(filters.html_escape(filters.decode.utf8(user_language)))
                        __M_writer(u'"></span>\n')
                else:
                    __M_writer(u'                                    <span class="not-achieve">')
                    __M_writer(filters.html_escape(filters.decode.utf8(_("Upcoming"))))
                    __M_writer(u'</span>\n')
                __M_writer(u'                                </div>\n                            </div>\n')
            __M_writer(u'                        </div>\n                        <button class="detail-collapse">\n                            <span class="fa fa-caret-up" aria-hidden="true"></span>\n                            <span class="requirement-detail">')
            __M_writer(filters.html_escape(filters.decode.utf8(_("Less"))))
            __M_writer(u'</span>\n                        </button>\n                    </div>\n                </section>\n')
        __M_writer(u'\n')
        if courseware_summary:
            __M_writer(u'                <section class="chapters">\n                    <h2 class="sr">')
            __M_writer(filters.html_escape(filters.decode.utf8(_('Details for each chapter'))))
            __M_writer(u'</h2>\n')
            loop = __M_loop._enter(courseware_summary)
            try:
                for chapter in loop:
                    if not chapter['display_name'] == "hidden":
                        __M_writer(u'                        <section aria-labelledby="chapter_')
                        __M_writer(filters.html_escape(filters.decode.utf8(loop.index)))
                        __M_writer(u'">\n                            <h3 class="hd hd-3" id="chapter_')
                        __M_writer(filters.html_escape(filters.decode.utf8(loop.index)))
                        __M_writer(u'">')
                        __M_writer(filters.html_escape(filters.decode.utf8( chapter['display_name'])))
                        __M_writer(u'</h3>\n                            <div class="sections">\n')
                        for section in chapter['sections']:
                            __M_writer(u'                                    <div>\n                                        ')

                            earned = section.all_total.earned
                            total = section.all_total.possible
                            
                            percentageString = "{0:.0%}".format(section.percent_graded) if earned > 0 and total > 0 else ""
                            
                            
                            __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 ['percentageString','total','earned'] if __M_key in __M_locals_builtin_stored]))
                            __M_writer(u'\n                                        <h4 class="hd hd-4">\n                                            <a href="')
                            __M_writer(filters.html_escape(filters.decode.utf8(reverse('courseware_section', kwargs=dict(course_id=text_type(course.id), chapter=chapter['url_name'], section=section.url_name)))))
                            __M_writer(u'">\n                                                ')
                            __M_writer(filters.html_escape(filters.decode.utf8( section.display_name)))
                            __M_writer(u'\n')
                            if total > 0 or earned > 0:
                                __M_writer(u'                                                <span class="sr">\n                                                    ')
                                __M_writer(filters.html_escape(filters.decode.utf8(_("{earned} of {total} possible points").format(earned='{:.3n}'.format(float(earned)), total='{:.3n}'.format(float(total))))))
                                __M_writer(u'\n                                                </span>\n')
                            __M_writer(u'                                            </a>\n')
                            if total > 0 or earned > 0:
                                __M_writer(u'                                            <span> ')
                                __M_writer(filters.html_escape(filters.decode.utf8("({0:.3n}/{1:.3n}) {2}".format( float(earned), float(total), percentageString ))))
                                __M_writer(u'</span>\n')
                            __M_writer(u'                                        </h4>\n                                        <p>\n')
                            if section.format is not None:
                                __M_writer(u'                                                ')
                                __M_writer(filters.html_escape(filters.decode.utf8(section.format)))
                                __M_writer(u'\n')
                            if section.due is not None:
                                __M_writer(u'                                                <em class="localized-datetime" data-datetime="')
                                __M_writer(filters.html_escape(filters.decode.utf8(section.due)))
                                __M_writer(u'" data-string="')
                                __M_writer(filters.html_escape(filters.decode.utf8(_('due {date}'))))
                                __M_writer(u'" data-timezone="')
                                __M_writer(filters.html_escape(filters.decode.utf8(user_timezone)))
                                __M_writer(u'" data-language="')
                                __M_writer(filters.html_escape(filters.decode.utf8(user_language)))
                                __M_writer(u'"></em>\n')
                            __M_writer(u'                                        </p>\n                                        <p class="override-notice">\n')
                            if section.override is not None:
                                if section.format is not None and section.format == "Exam":
                                    __M_writer(u'                                                    ')
                                    __M_writer(filters.html_escape(filters.decode.utf8(_("Suspicious activity detected during proctored exam review. Exam score 0."))))
                                    __M_writer(u'\n')
                                else:
                                    __M_writer(u'                                                    ')
                                    __M_writer(filters.html_escape(filters.decode.utf8(_("Section grade has been overridden."))))
                                    __M_writer(u'\n')
                            __M_writer(u'                                        </p>\n')
                            if len(section.problem_scores.values()) > 0:
                                if section.show_grades(staff_access):
                                    __M_writer(u'                                          <dl class="scores">\n                                              <dt class="hd hd-6">')
                                    __M_writer(filters.html_escape(filters.decode.utf8( _("Problem Scores: ") if section.graded else _("Practice Scores: "))))
                                    __M_writer(u'</dt>\n')
                                    for score in section.problem_scores.values():
                                        __M_writer(u'                                              <dd>')
                                        __M_writer(filters.html_escape(filters.decode.utf8("{0:.3n}/{1:.3n}".format(float(score.earned),float(score.possible)))))
                                        __M_writer(u'</dd>\n')
                                    __M_writer(u'                                          </dl>\n')
                                else:
                                    __M_writer(u'                                            <p class="hide-scores">\n')
                                    if section.show_correctness == 'past_due':
                                        if section.graded:
                                            __M_writer(u'                                                  ')
                                            __M_writer(filters.html_escape(filters.decode.utf8(_("Problem scores are hidden until the due date."))))
                                            __M_writer(u'\n')
                                        else:
                                            __M_writer(u'                                                  ')
                                            __M_writer(filters.html_escape(filters.decode.utf8(_("Practice scores are hidden until the due date."))))
                                            __M_writer(u'\n')
                                    else:
                                        if section.graded:
                                            __M_writer(u'                                                  ')
                                            __M_writer(filters.html_escape(filters.decode.utf8(_("Problem scores are hidden."))))
                                            __M_writer(u'\n')
                                        else:
                                            __M_writer(u'                                                  ')
                                            __M_writer(filters.html_escape(filters.decode.utf8(_("Practice scores are hidden."))))
                                            __M_writer(u'\n')
                                    __M_writer(u'                                            </p>\n')
                            else:
                                __M_writer(u'                                        <p class="no-scores">')
                                __M_writer(filters.html_escape(filters.decode.utf8(_("No problem scores in this section"))))
                                __M_writer(u'</p>\n')
                            __M_writer(u'                                    </div>\n')
                        __M_writer(u'                            </div>\n                        </section>\n')
            finally:
                loop = __M_loop._exit()
            __M_writer(u'                </section>\n')
        __M_writer(u'            </section>\n        </div>\n    </div>\n</main>\n')
        def ccall(caller):
            def body():
                __M_writer = context.writer()
                __M_writer(u'\n    DateUtilFactory.transform(iterationKey=".localized-datetime");\n')
                return ''
            return [body]
        context.caller_stack.nextcaller = runtime.Namespace('caller', context, callables=ccall(__M_caller))
        try:
            __M_writer(filters.html_escape(filters.decode.utf8(static.require_module_async(class_name=u'DateUtilFactory',module_name=u'js/dateutil_factory'))))
        finally:
            context.caller_stack.nextcaller = None
        __M_writer(u'\n')
        return ''
    finally:
        context.caller_stack._pop_frame()
예제 #23
0
def _mako_generate_namespaces(context):
    # SOURCE LINE 1
    ns = runtime.Namespace('__anon_0x208a7f0', context._clean_inheritance_tokens(), templateuri=u'teampage.mak', callables=None, calling_uri=_template_uri, module=None)
    context.namespaces[(__name__, '__anon_0x208a7f0')] = ns
def _mako_generate_namespaces(context):
    # SOURCE LINE 2
    ns = runtime.Namespace('__anon_0x6825e90', context._clean_inheritance_tokens(), templateuri=u'/root/history_common.mako', callables=None, calling_uri=_template_uri, module=None)
    context.namespaces[(__name__, '__anon_0x6825e90')] = ns
예제 #25
0
def render_body(context, **pageargs):
    __M_caller = context.caller_stack._push_frame()
    try:
        __M_locals = __M_dict_builtin(pageargs=pageargs)
        static = _mako_get_namespace(context, 'static')
        settings = context.get('settings', UNDEFINED)
        __M_writer = context.writer()
        __M_writer(u'\n')
        __M_writer(u'\n')
        __M_writer(
            u'\n\n<script type="text/javascript">\n  window.PLATFORM_NAME = "')
        __M_writer(js_escaped_string(settings.PLATFORM_NAME))
        __M_writer(u'";\n')
        if settings.FEATURES.get('ENABLE_DISCUSSION_HOME_PANEL', False):
            __M_writer(u'    window.ENABLE_DISCUSSION_HOME_PANEL = true;\n')
        else:
            __M_writer(u'    window.ENABLE_DISCUSSION_HOME_PANEL = false;\n')
        __M_writer(u'</script>\n\n')

        template_names = [
            'thread', 'thread-show', 'thread-edit', 'thread-response',
            'thread-response-show', 'thread-response-edit',
            'response-comment-show', 'response-comment-edit',
            'thread-list-item', 'search-alert', 'new-post',
            'new-post-menu-entry', 'new-post-menu-category', 'new-post-alert',
            'new-post-visibility', 'topic', 'post-user-display',
            'inline-discussion', 'pagination', 'profile-thread',
            'customwmd-prompt', 'nav-loading', 'thread-type'
        ]

        ## same, but without trailing "-template" in script ID - these templates does not contain any free variables
        template_names_no_suffix = [
            'forum-action-endorse', 'forum-action-answer',
            'forum-action-follow', 'forum-action-vote', 'forum-action-report',
            'forum-action-pin', 'forum-action-close', 'forum-action-edit',
            'forum-action-delete', 'forum-actions', 'alert-popup',
            'nav-load-more-link'
        ]

        __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 ['template_names', 'template_names_no_suffix']
                if __M_key in __M_locals_builtin_stored
            ]))
        __M_writer(u'\n\n')
        for template_name in template_names:
            __M_writer(u'<script aria-hidden="true" type="text/template" id="')
            __M_writer(filters.html_escape(filters.decode.utf8(template_name)))
            __M_writer(u'-template">\n    ')

            def ccall(caller):
                def body():
                    __M_writer = context.writer()
                    return ''

                return [body]

            context.caller_stack.nextcaller = runtime.Namespace(
                'caller', context, callables=ccall(__M_caller))
            try:
                __M_writer(
                    filters.html_escape(
                        filters.decode.utf8(
                            static.include(
                                path=u'common/templates/discussion/' +
                                (template_name) + u'.underscore'))))
            finally:
                context.caller_stack.nextcaller = None
            __M_writer(u'\n</script>\n')
        __M_writer(u'\n\n')
        for template_name in template_names_no_suffix:
            __M_writer(u'<script aria-hidden="true" type="text/template" id="')
            __M_writer(filters.html_escape(filters.decode.utf8(template_name)))
            __M_writer(u'">\n    ')

            def ccall(caller):
                def body():
                    __M_writer = context.writer()
                    return ''

                return [body]

            context.caller_stack.nextcaller = runtime.Namespace(
                'caller', context, callables=ccall(__M_caller))
            try:
                __M_writer(
                    filters.html_escape(
                        filters.decode.utf8(
                            static.include(
                                path=u'common/templates/discussion/' +
                                (template_name) + u'.underscore'))))
            finally:
                context.caller_stack.nextcaller = None
            __M_writer(u'\n</script>\n')
        return ''
    finally:
        context.caller_stack._pop_frame()