<commit_before><%page args="course_overview, enrollment, show_courseware_link, cert_status, can_unenroll, credit_status, show_email_settings, course_mode_info, show_refund_option, is_paid_course, is_course_blocked, verification_status, course_requirements, dashboard_index, share_settings, course_program_info, advanced_course_status, enroll_status, course_category, course_order, course_enroll_date" />

<%!
import pytz
import urllib

from django.utils.translation import ugettext as _
from django.utils.translation import ungettext
from django.core.urlresolvers import reverse
from markupsafe import escape
from courseware.ga_access import is_terminated
from course_modes.models import CourseMode
from course_modes.helpers import enrollment_mode_display
from student.helpers import (
  VERIFY_STATUS_NEED_TO_VERIFY,
  VERIFY_STATUS_SUBMITTED,
  VERIFY_STATUS_APPROVED,
  VERIFY_STATUS_MISSED_DEADLINE,
  VERIFY_STATUS_NEED_TO_REVERIFY,
  DISABLE_UNENROLL_CERT_STATES,
)
from util.date_utils import get_time_display
from ga_app.djangoapps.ga_diagnosis.models import DiagnosisInfo
from openedx.core.djangoapps.ga_optional.models import DashboardOptionalConfiguration
%>

<%
  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
  billing_email = settings.PAYMENT_SUPPORT_EMAIL
  view_course_button_conf = DashboardOptionalConfiguration.get_dict('view-course-button', enrollment.course_id)
  is_ga_diagnosis_finished = DiagnosisInfo.is_finished(user, enrollment.course_id)
%>

<%namespace name='static' file='../static_content.html'/>

<% time_zone = pytz.timezone(settings.TIME_ZONE_DISPLAYED_FOR_DEADLINES) %>
<li class="course-item"
    data-course-id="${enrollment.course_id}"
    data-course-name="${course_overview.display_name_with_default}"
    data-course-category="${course_category[0]['name']}"
    data-course-category2="${course_category[1]['name']}"
    data-course-status="${enroll_status}"
    data-course-order="${course_order}"
   data-course-enroll-date="${course_enroll_date}"
    % if course_overview.extra and course_overview.extra.self_paced:
        % if not course_overview.has_started():
            data-course-start-date="${get_time_display(course_overview.start, coerce_tz=time_zone.zone)}"
        % else:
            data-course-start-date="${get_time_display(enrollment.get_individual_start_date(), coerce_tz=time_zone.zone)}"
        % endif
        data-course-end-date="${get_time_display(enrollment.get_individual_end_date(), coerce_tz=time_zone.zone)}"
    % else:
        data-course-start-date="${course_overview.start_datetime_text("DATE_TIME", time_zone)}"
        data-course-end-date="${course_overview.end_datetime_text("DATE_TIME", time_zone)}"
    % endif
    % if unicode(enrollment.course_id) == u'gacco/ht001/2015_00':
        data-force-last="1"
    % else:
        data-force-last="0"
    % endif
    % if course_category[0]['name'] == u'gacco':
        data-priority-last="1"
    % else:
        data-priority-last="0"
    % endif
>
  % if settings.FEATURES.get('ENABLE_VERIFIED_CERTIFICATES'):
    <%
        course_verified_certs = enrollment_mode_display(
            enrollment.mode,
            verification_status.get('status'),
            course_overview.id
        )
    %>
    <%
        mode_class = course_verified_certs.get('display_mode', '')
        if mode_class != '':
            mode_class = ' ' + mode_class ;
    %>
  % else:
    <% mode_class = '' %>
  % endif
<div class="course-container">
 % if course_program_info and course_program_info['category']=='xseries':
  <div class="label-xseries-association">
    <i class="xseries-icon"></i>
    <p class="message-copy">${_("{category} Program Course").format(category=course_program_info['display_category'])}</p>
  </div>
 % endif
<article class="course${mode_class}">
  <% course_target = reverse('info', args=[unicode(course_overview.id)]) %>
  <section class="details">
    <div class="wrapper-course-image" aria-hidden="true">
      % if show_courseware_link:
        % if not is_course_blocked and view_course_button_conf:
          % if is_ga_diagnosis_finished:
            <a class="cover">
              <img src="${course_overview.course_image_url}" class="course-image" alt="${_('{course_number} {course_name} Cover Image').format(course_number=course_overview.number, course_name=course_overview.display_name_with_default) | h}" />
            </a>
          % else:
            <a href="${view_course_button_conf.get('href')}" data-course-key="${enrollment.course_id}" class="cover">
              <img src="${course_overview.course_image_url}" class="course-image" alt="${_('{course_number} {course_name} Home Page').format(course_number=course_overview.number, course_name=course_overview.display_name_with_default) |h}" />
            </a>
          % endif
        % elif not is_course_blocked:
            <a href="${course_target}" data-course-key="${enrollment.course_id}" class="cover">
              <img src="${course_overview.course_image_url}" class="course-image" alt="${_('{course_number} {course_name} Home Page').format(course_number=course_overview.number, course_name=course_overview.display_name_with_default) |h}" />
            </a>
        % else:
            <a class="fade-cover">
              <img src="${course_overview.course_image_url}" class="course-image" alt="${_('{course_number} {course_name} Cover Image').format(course_number=course_overview.number, course_name=course_overview.display_name_with_default) |h}" />
            </a>
        % endif
      % else:
        <a class="cover">
          <img src="${course_overview.course_image_url}" class="course-image" alt="${_('{course_number} {course_name} Cover Image').format(course_number=course_overview.number, course_name=course_overview.display_name_with_default) | h}" />
        </a>
      % endif
      % if settings.FEATURES.get('ENABLE_VERIFIED_CERTIFICATES') and course_verified_certs.get('display_mode') != 'audit':
        <span class="sts-enrollment" title="${course_verified_certs.get('enrollment_title')}">
          <span class="label">${_("Enrolled as: ")}</span>
          % if course_verified_certs.get('show_image'):
              <img class="deco-graphic" src="${static.url('images/verified-ribbon.png')}" alt="${course_verified_certs.get('image_alt')}" />
          % endif
          <div class="sts-enrollment-value">${course_verified_certs.get('enrollment_value')}</div>
        </span>
      % endif
      % if enrollment.course_id in paid_course_order_history_list:
        <div class="advanced-course-information paid-course purchased">
          <div class="label">${_("Purchased Paid Course")}</div>
          <a href="${reverse('verify_student_payment_confirmation', kwargs={'course_id': unicode(enrollment.course_id)})}?payment-order-num=${paid_course_order_history_list[enrollment.course_id]}" class="btn">${_("View Your Order")}</a>
        </div>
      % endif
      % if advanced_course_status.is_purchased():
        <div class="advanced-course-information advanced-course purchased">
          <div class="label">${_("Purchased Face-to-Face Course")}</div>
          % for order in advanced_course_status.get_purchased_orders():
          <a href="${reverse('shoppingcart.views.show_receipt', args=[order.id])}" class="btn">${_("View Your Order")}</a>
          % endfor
        </div>
      % elif course_overview.extra and course_overview.extra.is_f2f_course and course_overview.extra.is_f2f_course_sell:
        <div class="advanced-course-information advanced-course apply">
          <a href="${reverse('advanced_course:courses_face_to_face', args=[course_overview.id])}" class="btn">
            % if advanced_course_status.has_available_f2f_course():
            ${_("Face-to-Face Course Subscription")}
            % else:
            ${_("There is Face-to-Face Course")}
            % endif
          </a>
        </div>
      % endif
      % if is_ga_diagnosis_finished:
          <div class="advanced-course-information apply">
              <a href="${reverse('ga_app:diagnosis:result', args=[enrollment.course_id])}" class="btn">
                  ${_("View your MDA")}<commit_msg>[fix] dashboard Display condition change<commit_after><%page args="course_overview, enrollment, show_courseware_link, cert_status, can_unenroll, credit_status, show_email_settings, course_mode_info, show_refund_option, is_paid_course, is_course_blocked, verification_status, course_requirements, dashboard_index, share_settings, course_program_info, advanced_course_status, enroll_status, course_category, course_order, course_enroll_date" />

<%!
import pytz
import urllib

from django.utils.translation import ugettext as _
from django.utils.translation import ungettext
from django.core.urlresolvers import reverse
from markupsafe import escape
from courseware.ga_access import is_terminated
from course_modes.models import CourseMode
from course_modes.helpers import enrollment_mode_display
from student.helpers import (
  VERIFY_STATUS_NEED_TO_VERIFY,
  VERIFY_STATUS_SUBMITTED,
  VERIFY_STATUS_APPROVED,
  VERIFY_STATUS_MISSED_DEADLINE,
  VERIFY_STATUS_NEED_TO_REVERIFY,
  DISABLE_UNENROLL_CERT_STATES,
)
from util.date_utils import get_time_display
from ga_app.djangoapps.ga_diagnosis.models import DiagnosisInfo
from openedx.core.djangoapps.ga_optional.models import DashboardOptionalConfiguration
%>

<%
  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
  billing_email = settings.PAYMENT_SUPPORT_EMAIL
  view_course_button_conf = DashboardOptionalConfiguration.get_dict('view-course-button', enrollment.course_id)
  is_ga_diagnosis_finished = DiagnosisInfo.is_finished(user, enrollment.course_id)
%>

<%namespace name='static' file='../static_content.html'/>

<% time_zone = pytz.timezone(settings.TIME_ZONE_DISPLAYED_FOR_DEADLINES) %>
<li class="course-item"
    data-course-id="${enrollment.course_id}"
    data-course-name="${course_overview.display_name_with_default}"
    data-course-category="${course_category[0]['name']}"
    data-course-category2="${course_category[1]['name']}"
    data-course-status="${enroll_status}"
    data-course-order="${course_order}"
   data-course-enroll-date="${course_enroll_date}"
    % if course_overview.extra and course_overview.extra.self_paced:
        % if not course_overview.has_started():
            data-course-start-date="${get_time_display(course_overview.start, coerce_tz=time_zone.zone)}"
        % else:
            data-course-start-date="${get_time_display(enrollment.get_individual_start_date(), coerce_tz=time_zone.zone)}"
        % endif
        data-course-end-date="${get_time_display(enrollment.get_individual_end_date(), coerce_tz=time_zone.zone)}"
    % else:
        data-course-start-date="${course_overview.start_datetime_text("DATE_TIME", time_zone)}"
        data-course-end-date="${course_overview.end_datetime_text("DATE_TIME", time_zone)}"
    % endif
    % if unicode(enrollment.course_id) == u'gacco/ht001/2015_00':
        data-force-last="1"
    % else:
        data-force-last="0"
    % endif
    % if course_category[0]['name'] == u'gacco':
        data-priority-last="1"
    % else:
        data-priority-last="0"
    % endif
>
  % if settings.FEATURES.get('ENABLE_VERIFIED_CERTIFICATES'):
    <%
        course_verified_certs = enrollment_mode_display(
            enrollment.mode,
            verification_status.get('status'),
            course_overview.id
        )
    %>
    <%
        mode_class = course_verified_certs.get('display_mode', '')
        if mode_class != '':
            mode_class = ' ' + mode_class ;
    %>
  % else:
    <% mode_class = '' %>
  % endif
<div class="course-container">
 % if course_program_info and course_program_info['category']=='xseries':
  <div class="label-xseries-association">
    <i class="xseries-icon"></i>
    <p class="message-copy">${_("{category} Program Course").format(category=course_program_info['display_category'])}</p>
  </div>
 % endif
<article class="course${mode_class}">
  <% course_target = reverse('info', args=[unicode(course_overview.id)]) %>
  <section class="details">
    <div class="wrapper-course-image" aria-hidden="true">
      % if show_courseware_link:
        % if not is_course_blocked and view_course_button_conf:
          % if is_ga_diagnosis_finished:
            <a class="cover">
              <img src="${course_overview.course_image_url}" class="course-image" alt="${_('{course_number} {course_name} Cover Image').format(course_number=course_overview.number, course_name=course_overview.display_name_with_default) | h}" />
            </a>
          % else:
            <a href="${view_course_button_conf.get('href')}" data-course-key="${enrollment.course_id}" class="cover">
              <img src="${course_overview.course_image_url}" class="course-image" alt="${_('{course_number} {course_name} Home Page').format(course_number=course_overview.number, course_name=course_overview.display_name_with_default) |h}" />
            </a>
          % endif
        % elif not is_course_blocked:
            <a href="${course_target}" data-course-key="${enrollment.course_id}" class="cover">
              <img src="${course_overview.course_image_url}" class="course-image" alt="${_('{course_number} {course_name} Home Page').format(course_number=course_overview.number, course_name=course_overview.display_name_with_default) |h}" />
            </a>
        % else:
            <a class="fade-cover">
              <img src="${course_overview.course_image_url}" class="course-image" alt="${_('{course_number} {course_name} Cover Image').format(course_number=course_overview.number, course_name=course_overview.display_name_with_default) |h}" />
            </a>
        % endif
      % else:
        <a class="cover">
          <img src="${course_overview.course_image_url}" class="course-image" alt="${_('{course_number} {course_name} Cover Image').format(course_number=course_overview.number, course_name=course_overview.display_name_with_default) | h}" />
        </a>
      % endif
      % if settings.FEATURES.get('ENABLE_VERIFIED_CERTIFICATES') and course_verified_certs.get('display_mode') != 'audit':
        <span class="sts-enrollment" title="${course_verified_certs.get('enrollment_title')}">
          <span class="label">${_("Enrolled as: ")}</span>
          % if course_verified_certs.get('show_image'):
              <img class="deco-graphic" src="${static.url('images/verified-ribbon.png')}" alt="${course_verified_certs.get('image_alt')}" />
          % endif
          <div class="sts-enrollment-value">${course_verified_certs.get('enrollment_value')}</div>
        </span>
      % endif
      % if enrollment.course_id in paid_course_order_history_list:
        <div class="advanced-course-information paid-course purchased">
          <div class="label">${_("Purchased Paid Course")}</div>
          <a href="${reverse('verify_student_payment_confirmation', kwargs={'course_id': unicode(enrollment.course_id)})}?payment-order-num=${paid_course_order_history_list[enrollment.course_id]}" class="btn">${_("View Your Order")}</a>
        </div>
      % endif
      % if advanced_course_status.is_purchased():
        <div class="advanced-course-information advanced-course purchased">
          <div class="label">${_("Purchased Face-to-Face Course")}</div>
          % for order in advanced_course_status.get_purchased_orders():
          <a href="${reverse('shoppingcart.views.show_receipt', args=[order.id])}" class="btn">${_("View Your Order")}</a>
          % endfor
        </div>
      % elif course_overview.extra and course_overview.extra.is_f2f_course:
        <div class="advanced-course-information advanced-course apply">
          <a href="${reverse('advanced_course:courses_face_to_face', args=[course_overview.id])}" class="btn">
            % if advanced_course_status.has_available_f2f_course():
            ${_("Face-to-Face Course Subscription")}
            % else:
            ${_("There is Face-to-Face Course")}
            % endif
          </a>
        </div>
      % endif
      % if is_ga_diagnosis_finished:
          <div class="advanced-course-information apply">
              <a href="${reverse('ga_app:diagnosis:result', args=[enrollment.course_id])}" class="btn">
                  ${_("View your MDA")}
{'fraction_non_alphanumeric': 0.1375134875914159, 'fraction_numerical': 0.002337849178755545, 'mean_word_length': 4.115915363385464, 'pattern_counts': {'":': 4, '<': 123, '<?xml version=': 0, '>': 123, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7055235', 'n_tokens_mistral': 5374, 'n_tokens_neox': 5202, 'n_words': 751}