%!
import json
from django.utils.translation import ugettext as _
from microsite_configuration import microsite
from openedx.core.lib.json_utils import EscapedEdxJSONEncoder
%>
<%inherit file="../main.html" />
<%namespace name='static' file='../static_content.html'/>
% if settings.FEATURES.get('ENABLE_COURSE_DISCOVERY'):
<%block name="header_extras">
% for template_name in ["result_item", "filter_bar", "filter", "search_facets_list", "search_facets_section", "search_facet", "more_less_links"]:
% endfor
<%static:require_module module_name="js/discovery/discovery_factory" class_name="DiscoveryFactory">
DiscoveryFactory(
${json.dumps(course_discovery_meanings, cls=EscapedEdxJSONEncoder)},
getParameterByName('search_query')
);
%static:require_module>
%block>
% endif
<%block name="pagetitle">${_("Courses")}%block>
<%
platform_name = microsite.get_value('platform_name', settings.PLATFORM_NAME)
course_discovery_enabled = settings.FEATURES.get('ENABLE_COURSE_DISCOVERY')
if self.stanford_theme_enabled():
course_index_overlay_text = _("Explore free courses from {university_name}.").format(university_name="Stanford University")
logo_file = static.url('themes/stanford/images/seal.png')
logo_alt_text = "Stanford Seal Logo"
else:
course_index_overlay_text = microsite.get_value('course_index_overlay_text', _("Explore courses from {platform_name}.").format(platform_name=platform_name))
if settings.FEATURES.get('IS_EDX_DOMAIN', False):
# For some reason, `static.url('images/edx-theme/edx-logo-bw.png')` breaks template rendering.
default_image_url = settings.STATIC_URL + 'images/edx-theme/edx-logo-bw.png'
else:
default_image_url = settings.STATIC_URL + 'images/default-theme/logo-large.png'
logo_file = microsite.get_value(
'course_index_overlay_logo_file', default_image_url
)
logo_alt_text = _("{platform_name} Logo").format(platform_name=platform_name)
%>
% if course_discovery_enabled:
% endif
%for course in courses:
-
<%include file="../course.html" args="course=course" />
%endfor
% if course_discovery_enabled:
% endif