Exemple #1
0
 def can_show_upgrade_sock(self):
     return DISPLAY_COURSE_SOCK_FLAG.is_enabled(self.course_key)
 def get_can_show_upgrade_sock(self, _):
     course_overview = self.context['course_overview']
     return DISPLAY_COURSE_SOCK_FLAG.is_enabled(course_overview.id)
Exemple #3
0
 def can_show_upgrade_sock(self):
     return (DISPLAY_COURSE_SOCK_FLAG.is_enabled(self.course_key)
             and can_show_verified_upgrade(self.effective_user,
                                           self.enrollment_object))
def render_content(context, **pageargs):
    __M_caller = context.caller_stack._push_frame()
    try:
        upgrade_url = context.get('upgrade_url', UNDEFINED)
        settings = context.get('settings', UNDEFINED)

        def content():
            return render_content(context)

        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')
        if show_course_sock:
            __M_writer(u'    <div class="verification-sock"\n')
            if not DISPLAY_COURSE_SOCK_FLAG.is_enabled(course_id):
                __M_writer(u'        style="display: none"\n')
            __M_writer(
                u'    >\n        <button type="button" aria-expanded="false" class="btn btn-primary focusable action-toggle-verification-sock">\n            '
            )
            __M_writer(
                filters.html_escape(
                    filters.decode.utf8(
                        _('Learn About Verified Certificates'))))
            __M_writer(
                u'\n        </button>\n        <div class="verification-main-panel">\n            <div class="verification-desc-panel content-main">\n                <h2>'
            )
            __M_writer(
                filters.html_escape(
                    filters.decode.utf8(
                        _('{platform_name} Verified Certificate').format(
                            platform_name=settings.PLATFORM_NAME))))
            __M_writer(u'</h2>\n                <h3>')
            __M_writer(
                filters.html_escape(filters.decode.utf8(_('Why upgrade?'))))
            __M_writer(
                u'</h3>\n                <ul>\n                    <li>')
            __M_writer(
                filters.html_escape(
                    filters.decode.utf8(_('Official proof of completion'))))
            __M_writer(u'</li>\n                    <li>')
            __M_writer(
                filters.html_escape(
                    filters.decode.utf8(_('Easily shareable certificate'))))
            __M_writer(u'</li>\n                    <li>')
            __M_writer(
                filters.html_escape(
                    filters.decode.utf8(
                        _('Proven motivator to complete the course'))))
            __M_writer(u'</li>\n                    <li>')
            __M_writer(
                filters.html_escape(
                    filters.decode.utf8(
                        _('Certificate purchases help {platform_name} continue to offer free courses'
                          ).format(platform_name=settings.PLATFORM_NAME))))
            __M_writer(u'</li>\n                </ul>\n                <h3>')
            __M_writer(
                filters.html_escape(filters.decode.utf8(_('How it works'))))
            __M_writer(
                u'</h3>\n                <ul>\n                    <li>')
            __M_writer(
                filters.html_escape(
                    filters.decode.utf8(
                        _('Pay the Verified Certificate upgrade fee'))))
            __M_writer(u'</li>\n                    <li>')
            __M_writer(
                filters.html_escape(
                    filters.decode.utf8(
                        _('Verify your identity with a webcam and government-issued ID'
                          ))))
            __M_writer(u'</li>\n                    <li>')
            __M_writer(
                filters.html_escape(
                    filters.decode.utf8(_('Study hard and pass the course'))))
            __M_writer(u'</li>\n                    <li>')
            __M_writer(
                filters.html_escape(
                    filters.decode.utf8(
                        _('Share your certificate with friends, employers, and others'
                          ))))
            __M_writer(u'</li>\n                </ul>\n')
            if settings.PLATFORM_NAME == 'edX':
                __M_writer(u'                    <h3>')
                __M_writer(
                    filters.html_escape(
                        filters.decode.utf8(_('edX Learner Stories'))))
                __M_writer(
                    u'</h3>\n                    <div class="learner-story-container">\n                        <img class="student-image" alt="Student Image" src="'
                )
                __M_writer(
                    filters.html_escape(
                        filters.decode.utf8(
                            static.url(
                                'course_experience/images/learner-quote.png')))
                )
                __M_writer(
                    u'" />\n                        <div class="story-quote">\n                            '
                )
                __M_writer(
                    filters.html_escape(
                        filters.decode.utf8(
                            _('My certificate has helped me showcase my knowledge on my \
                            resume - I feel like this certificate could really help me land \
                            my dream job!'))))
                __M_writer(
                    u'\n                            <span class="author">- ')
                __M_writer(
                    filters.html_escape(
                        filters.decode.utf8(
                            _('{learner_name}, edX Learner').format(
                                learner_name='Christina Fong'))))
                __M_writer(
                    u'</span>\n                        </div>\n                    </div>\n                    <div class="learner-story-container">\n                        <img class="student-image" alt="Student Image" src="'
                )
                __M_writer(
                    filters.html_escape(
                        filters.decode.utf8(
                            static.url(
                                'course_experience/images/learner-quote2.png'))
                    ))
                __M_writer(
                    u'" />\n                        <div class="story-quote">\n                            '
                )
                __M_writer(
                    filters.html_escape(
                        filters.decode.utf8(
                            _('I wanted to include a verified certificate on my resume and my profile to \
                            illustrate that I am working towards this goal I have and that I have \
                            achieved something while I was unemployed.'))))
                __M_writer(
                    u'<br/>\n                            <span class="author">- '
                )
                __M_writer(
                    filters.html_escape(
                        filters.decode.utf8(
                            _('{learner_name}, edX Learner').format(
                                learner_name='Cheryl Troell'))))
                __M_writer(
                    u'</span>\n                        </div>\n                    </div>\n'
                )
            __M_writer(
                u'                <img class="mini-cert" alt="Example Certificate Image" src="'
            )
            __M_writer(
                filters.html_escape(
                    filters.decode.utf8(
                        static.url(
                            'course_experience/images/verified-cert.png'))))
            __M_writer(u'"/>\n                <a href="')
            __M_writer(filters.html_escape(filters.decode.utf8(upgrade_url)))
            __M_writer(
                u'">\n                    <div class="btn btn-upgrade stuck-top focusable action-upgrade-certificate" data-creative="original_sock" data-position="sock">\n                        '
            )
            __M_writer(
                filters.html_escape(
                    filters.decode.utf8(
                        Text(_('Upgrade ({course_price})')).format(
                            course_price=HTML(course_price)))))
            __M_writer(
                u'\n                    </div>\n                </a>\n            </div>\n        </div>\n    </div>\n'
            )
        return ''
    finally:
        context.caller_stack._pop_frame()