<commit_before><%page expression_filter="h" args="cert_status, course_overview, enrollment, reverify_link" />

<%!
from django.utils.translation import ugettext as _
from openedx.core.djangolib.markup import HTML, Text
from course_modes.models import CourseMode
%>
<%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-processing'
elif cert_status['status'] == 'generating':
    status_css_class = 'course-status-certrendering'
elif cert_status['status'] == 'downloadable':
    status_css_class = 'course-status-certavailable'
elif cert_status['status'] == 'notpassing':
    status_css_class = 'course-status-certnotavailable'
else:
    status_css_class = 'course-status-processing'
%>

% if cert_status['status'] != 'processing':
  % if cert_status['status'] == 'certificate_earned_but_not_available':
    <div class="message message-status ${status_css_class} is-shown">
      <p class="message-copy">
        <%
          certificate_available_date_string = course_overview.certificate_available_date.strftime('%Y-%m-%dT%H:%M:%S%z')
          container_string = _("Your certificate will be available on or before {date}")
          format = 'shortDate'
        %>
        <span class="info-date-block localized-datetime" data-language="${user_language}" data-timezone="${user_timezone}" data-datetime="${certificate_available_date_string}" data-format=${format} data-string="${container_string}"></span>
      </p>
    </div>
  % else:
    <div class="message message-status ${status_css_class} is-shown">
      <p class="message-copy">${_("Your final grade:")}
        <span class="grade-value">${"{0:.0f}%".format(float(cert_status['grade'])*100)}</span>.

        % if 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
          <span class="grade-value">${"{0:.0f}%".format(float(course_overview.lowest_passing_grade)*100)}</span>.
        % elif cert_status['status'] == 'restricted' and enrollment.mode == 'verified':
          <p class="message-copy">
            ${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('<a class="contact-link" href="mailto:{email}">{email}</a>.').format(email=settings.CONTACT_EMAIL), billing_email=HTML('<a class="contact-link" href="mailto:{email}">{email}</a>').format(email=settings.PAYMENT_SUPPORT_EMAIL), cert_name_short=cert_name_short, cert_name_long=cert_name_long)}
          </p>
        % elif cert_status['status'] == 'restricted':
          <p class="message-copy">
            ${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('<a class="contact-link" href="mailto:{email}">{email}</a>.').format(email=settings.CONTACT_EMAIL), cert_name_short=cert_name_short, cert_name_long=cert_name_long)}
          </p>
        % elif cert_status['status'] == 'unverified':
          <p class="message-copy">
            ${Text(_("Your certificate was not issued because you do not have a current verified identity with {platform_name}. ")).format(platform_name=settings.PLATFORM_NAME)}
            <a href="${reverify_link}"> ${Text(_("Verify your identity now."))}</a>
          </p>
        % endif

      </p>

      % if cert_status['status'] == 'generating' or cert_status['status'] == 'downloadable' or cert_status['show_survey_button']:
        <div class="wrapper-message-primary">
          <ul class="actions actions-primary">
            % if cert_status['status'] == 'generating':
              <li class="action">
                <span class="disabled">
                  ${_("Your {cert_name_short} is Generating").format(cert_name_short=cert_name_short)}
                </span>
              </li>
            % elif cert_status['status'] == 'downloadable' and cert_status.get('show_cert_web_view', False):
              <li class="action action-certificate">
                <a class="btn" href="${cert_status['cert_web_view_url']}" target="_blank"
                   title="${_('This link will open the certificate web view')}">
                  ${_("View {cert_name_short}").format(cert_name_short=cert_name_short,)}
                </a>
              </li>
            % elif cert_status['status'] == 'downloadable' and enrollment.mode in CourseMode.NON_VERIFIED_MODES:
              <li class="action action-certificate">
                <a class="btn" href="${cert_status['download_url']}"
                   title="${_('This link will open/download a PDF document')}">
                  ${_("Download {cert_name_short} (PDF)").format(cert_name_short=cert_name_short,)}
                </a><commit_msg>protect to only show if grade > zero<commit_after><%page expression_filter="h" args="cert_status, course_overview, enrollment, reverify_link" />

<%!
from django.utils.translation import ugettext as _
from openedx.core.djangolib.markup import HTML, Text
from course_modes.models import CourseMode
%>
<%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-processing'
elif cert_status['status'] == 'generating':
    status_css_class = 'course-status-certrendering'
elif cert_status['status'] == 'downloadable':
    status_css_class = 'course-status-certavailable'
elif cert_status['status'] == 'notpassing':
    status_css_class = 'course-status-certnotavailable'
else:
    status_css_class = 'course-status-processing'
%>

% if cert_status['status'] != 'processing':
  % if cert_status['status'] == 'certificate_earned_but_not_available':
    <div class="message message-status ${status_css_class} is-shown">
      <p class="message-copy">
        <%
          certificate_available_date_string = course_overview.certificate_available_date.strftime('%Y-%m-%dT%H:%M:%S%z')
          container_string = _("Your certificate will be available on or before {date}")
          format = 'shortDate'
        %>
        <span class="info-date-block localized-datetime" data-language="${user_language}" data-timezone="${user_timezone}" data-datetime="${certificate_available_date_string}" data-format=${format} data-string="${container_string}"></span>
      </p>
    </div>
  % else:
    <div class="message message-status ${status_css_class} is-shown">

      % if float(cert_status['grade']) > 0.0:
        <p class="message-copy">${_("Your final grade:")}
          <span class="grade-value">${"{0:.0f}%".format(float(cert_status['grade'])*100)}</span>.
      
          % if 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
            <span class="grade-value">${"{0:.0f}%".format(float(course_overview.lowest_passing_grade)*100)}</span>.
          % elif cert_status['status'] == 'restricted' and enrollment.mode == 'verified':
            <p class="message-copy">
              ${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('<a class="contact-link" href="mailto:{email}">{email}</a>.').format(email=settings.CONTACT_EMAIL), billing_email=HTML('<a class="contact-link" href="mailto:{email}">{email}</a>').format(email=settings.PAYMENT_SUPPORT_EMAIL), cert_name_short=cert_name_short, cert_name_long=cert_name_long)}
            </p>
          % elif cert_status['status'] == 'restricted':
            <p class="message-copy">
              ${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('<a class="contact-link" href="mailto:{email}">{email}</a>.').format(email=settings.CONTACT_EMAIL), cert_name_short=cert_name_short, cert_name_long=cert_name_long)}
            </p>
          % elif cert_status['status'] == 'unverified':
            <p class="message-copy">
              ${Text(_("Your certificate was not issued because you do not have a current verified identity with {platform_name}. ")).format(platform_name=settings.PLATFORM_NAME)}
              <a href="${reverify_link}"> ${Text(_("Verify your identity now."))}</a>
            </p>
          % endif

        </p>
      % endif

      % if cert_status['status'] == 'generating' or cert_status['status'] == 'downloadable' or cert_status['show_survey_button']:
        <div class="wrapper-message-primary">
          <ul class="actions actions-primary">
            % if cert_status['status'] == 'generating':
              <li class="action">
                <span class="disabled">
                  ${_("Your {cert_name_short} is Generating").format(cert_name_short=cert_name_short)}
                </span>
              </li>
            % elif cert_status['status'] == 'downloadable' and cert_status.get('show_cert_web_view', False):
              <li class="action action-certificate">
                <a class="btn" href="${cert_status['cert_web_view_url']}" target="_blank"
                   title="${_('This link will open the certificate web view')}">
                  ${_("View {cert_name_short}").format(cert_name_short=cert_name_short,)}
                </a>
              </li>
            % elif cert_status['status'] == 'downloadable' and enrollment.mode in CourseMode.NON_VERIFIED_MODES:
              <li class="action action-certificate">
                <a class="btn" href="${cert_status['download_url']}"
                   title="${_('This link will open/download a PDF document')}">
                  ${_("Download {cert_name_short} (PDF)").format(cert_name_short=cert_name_short,)}
                </a>
{'fraction_non_alphanumeric': 0.14312585499316005, 'fraction_numerical': 0.001880984952120383, 'mean_word_length': 3.6251482799525503, 'pattern_counts': {'":': 4, '<': 95, '<?xml version=': 0, '>': 97, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '531586', 'n_tokens_mistral': 3513, 'n_tokens_neox': 3387, 'n_words': 761}