%page expression_filter="h" args="cert_status, course_ended_not_passing, course_overview, enrollment, reverify_link" />
<%!
from django.urls import reverse
from django.utils.translation import ugettext as _
from openedx.core.djangolib.markup import HTML, Text
from common.djangoapps.course_modes.models import CourseMode
from lms.djangoapps.certificates.data import CertificateStatuses
from xmodule.data import CertificatesDisplayBehaviors
from common.djangoapps.student.helpers import user_has_passing_grade_in_course
%>
<%namespace name='static' file='../static_content.html'/>
<%
cert_name_short = course_overview.cert_name_short
if cert_name_short == "":
cert_name_short = settings.CERT_NAME_SHORT
cert_name_long = course_overview.cert_name_long
if cert_name_long == "":
cert_name_long = settings.CERT_NAME_LONG
%>
<%
if cert_status['status'] == 'certificate_earned_but_not_available':
status_css_class = 'course-status-earned-not-available'
elif cert_status['status'] == CertificateStatuses.generating:
status_css_class = 'course-status-certrendering'
elif cert_status['status'] == CertificateStatuses.downloadable or cert_status['status'] == CertificateStatuses.requesting:
status_css_class = 'course-status-certavailable'
elif cert_status['status'] == CertificateStatuses.notpassing:
status_css_class = 'course-status-certnotavailable'
else:
status_css_class = 'course-status-processing'
%>
<%
requesting_post_url = reverse('generate_user_cert', args=[str(course_overview.id)])
progress_page_url = reverse('progress', args=[str(course_overview.id)])
%>
% if cert_status['status'] != 'processing':
% if cert_status['status'] == 'certificate_earned_but_not_available':
% if cert_status['status'] == CertificateStatuses.downloadable or cert_status['status'] == CertificateStatuses.requesting:
${_("Congratulations! Your certificate is ready.")}
% elif cert_status['status'] == 'notpassing':
% if enrollment.mode != 'audit':
${_("Grade required for a {cert_name_short}:").format(cert_name_short=cert_name_short)}
% else:
${_("Grade required to pass this course:")}
% endif
${"{0:.0f}%".format(float(course_overview.lowest_passing_grade)*100)}.
% elif cert_status['status'] == 'restricted' and enrollment.mode == 'verified':
${Text(_("Your verified {cert_name_long} is being held pending confirmation that the issuance of your {cert_name_short} is in compliance with strict U.S. embargoes on Iran, Cuba, Syria and Sudan. If you think our system has mistakenly identified you as being connected with one of those countries, please let us know by contacting {email}. If you would like a refund on your {cert_name_long}, please contact our billing address {billing_email}")).format(email=HTML('{email}.').format(email=settings.CONTACT_EMAIL), billing_email=HTML('{email}').format(email=settings.PAYMENT_SUPPORT_EMAIL), cert_name_short=cert_name_short, cert_name_long=cert_name_long)}
% elif cert_status['status'] == 'restricted':
${Text(_("Your {cert_name_long} is being held pending confirmation that the issuance of your {cert_name_short} is in compliance with strict U.S. embargoes on Iran, Cuba, Syria and Sudan. If you think our system has mistakenly identified you as being connected with one of those countries, please let us know by contacting {email}.")).format(email=HTML('{email}.').format(email=settings.CONTACT_EMAIL), cert_name_short=cert_name_short, cert_name_long=cert_name_long)}
% elif cert_status['status'] == 'unverified':
${Text(_("Your certificate was not issued because you do not have a current verified identity with {platform_name}. ")).format(platform_name=settings.PLATFORM_NAME)}
% endif
% if cert_status['status'] == CertificateStatuses.generating or cert_status['status'] == CertificateStatuses.downloadable or cert_status['status'] == CertificateStatuses.requesting or cert_status['show_survey_button']:
% if cert_status['status'] == 'downloadable' and cert_status['linked_in_url']:
% endif
% endif
% if cert_status['status'] == 'downloadable' and enrollment.mode == 'verified' and cert_status['mode'] == 'honor':
${_('Since we did not have a valid set of verification photos from you when your {cert_name_long} was generated, we could not grant you a verified {cert_name_short}. An honor code {cert_name_short} has been granted instead.').format(cert_name_short=cert_name_short, cert_name_long=cert_name_long)}
% endif
% endif
% elif course_ended_not_passing:
<%
container_string = _("You are not eligible for a certificate.")
%>
% endif