% if show_courseware_link and not is_unfulfilled_entitlement:
% if not is_course_blocked:
% else:
% endif
% else:
% endif
% if display_course_modes_on_dashboard and course_verified_certs.get('display_mode') != 'audit':
${_("Enrolled as: ")}
% if course_verified_certs.get('show_image'):
% endif
${course_overview.display_org_with_default} - ${course_overview.display_number_with_default}
<%
if course_overview.start_date_is_still_default:
container_string = _("Coming Soon")
course_date = None
else:
format = 'shortDate'
if course_overview.has_ended():
container_string = _("Ended - {date}")
course_date = course_overview.end
elif course_overview.has_started():
container_string = _("Started - {date}")
course_date = course_overview.dashboard_start_display
elif course_overview.starts_within(days=5):
container_string = _("Starts - {date}")
course_date = course_overview.dashboard_start_display
format = 'defaultFormat'
else: ## hasn't started yet
container_string = _("Starts - {date}")
course_date = course_overview.dashboard_start_display
endif
endif
%>
% if is_unfulfilled_entitlement:
% if entitlement_expired_at:
${_('You can no longer select a session, your final day to select a session was {entitlement_expired_at}.').format(entitlement_expired_at=entitlement_expired_at)}
% else:
% if entitlement_expiration_date:
${_('You must select a session by {expiration_date} to access the course.').format(expiration_date=entitlement_expiration_date)}
% else:
${_('You must select a session to access the course.')}
% endif
% endif
% else:
% if isinstance(course_date, basestring):
${container_string.format(date=course_date)}
% elif course_date is not None:
% endif
% endif
% if entitlement:
% if not entitlement_expired_at:
% endif
% endif
% if entitlement and not is_unfulfilled_entitlement and entitlement_expiration_date:
% if entitlement_expired_at:
${_('You can no longer change sessions.')}
% else:
${_('You can change sessions until {entitlement_expiration_date}.').format(entitlement_expiration_date=entitlement_expiration_date)}
% endif
% endif
% if show_courseware_link or is_unfulfilled_entitlement:
% if course_overview.has_ended():
% if not is_course_blocked:
${_('View Archived Course')} ${course_overview.display_name_with_default}
% else:
${_('View Archived Course')} ${course_overview.display_name_with_default}
% endif
% else:
% if not is_course_blocked:
${_('View Course')} ${course_overview.display_name_with_default}
% else:
${_('View Course')} ${course_overview.display_name_with_default}
% endif
% endif
% endif
% if show_courseware_link or course_overview.has_social_sharing_url() or course_overview.has_marketing_url():
% if share_settings:
<%
share_url = get_link_for_about_page(course_overview)
encoded_utm_parameters = get_encoded_course_sharing_utm_params()
share_window_name = 'shareWindow'
share_window_config = 'toolbar=no, location=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=640, height=480'
%>
% if share_settings.get('DASHBOARD_FACEBOOK', False):
<%
facebook_share_url = "{url}?{utm_params}".format(url=share_url.encode('utf-8'), utm_params=encoded_utm_parameters['facebook'])
share_text = _("I'm taking {course_name} online with {facebook_brand}. Check it out!").format(course_name=course_overview.display_name_with_default, facebook_brand=share_settings.get('FACEBOOK_BRAND', 'edX.org'))
query_params = urllib.urlencode((('u', facebook_share_url), ('quote', share_text.encode('utf-8')),))
facebook_url = 'https://www.facebook.com/sharer/sharer.php?{query}'.format(query=query_params)
share_msg = _("Share {course_name} on Facebook").format(course_name=course_overview.display_name_with_default)
%>
${share_msg}
% endif
% if share_settings.get('DASHBOARD_TWITTER', False):
<%
twitter_share_url = "{url}?{utm_params}".format(url=share_url.encode('utf-8'), utm_params=encoded_utm_parameters['twitter'])
default_share_text = _("I'm taking {course_name} online with {twitter_brand}. Check it out!").format(course_name=course_overview.display_name_with_default, twitter_brand=share_settings.get('TWITTER_BRAND', '@edxonline'))
share_text = urllib.quote_plus(share_settings.get('DASHBOARD_TWITTER_TEXT', default_share_text.encode('utf-8')))
twitter_url = 'https://twitter.com/intent/tweet?text=' + share_text + '%20' + urllib.quote_plus(twitter_share_url)
share_msg = _("Share {course_name} on Twitter").format(course_name=course_overview.display_name_with_default)
%>
${share_msg}
% endif
% endif
% endif
## Right now, the gear dropdown for entitlements only contains the 'unenroll' link, so we should hide the
## gear altogether if the user is unable to unenroll/refund their entitlement. Later, when we add more options
## to the gear dropdown, we can remove this check.
% if entitlement and can_refund_entitlement:
<%include file='_dashboard_entitlement_actions.html' args='course_overview=course_overview,entitlement=entitlement,dashboard_index=dashboard_index, can_refund_entitlement=can_refund_entitlement'/>
% elif not entitlement:
% if can_unenroll:
<% course_refund_url = reverse('course_run_refund_status', args=[unicode(course_overview.id)]) %>
% if not is_course_blocked:
${_('Unenroll')}
% else:
${_('Unenroll')}
% endif