<commit_before><%!
  import json
  from django.utils.translation import ugettext as _
  from microsite_configuration import microsite
%>
<%inherit file="../main.html" />

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

<%block name="header_extras">
  % if settings.FEATURES.get('ENABLE_COURSE_DISCOVERY'):
  % for template_name in ["result_item", "filter_bar", "filter", "search_facets_list", "search_facets_section", "search_facet", "more_less_links"]:
  <script type="text/template" id="${template_name}-tpl">
      <%static:include path="discovery/${template_name}.underscore" />
  </script>
  % endfor
  <script type="text/javascript">;(function (define) {{
      define('course_discovery_meanings', function() {{
          'use strict';
          return ${json.dumps(course_discovery_meanings)};
        }});
      }})(define || RequireJS.define);
  </script>
  % endif
</%block>

<%block name="js_extra">
  % if settings.FEATURES.get('ENABLE_COURSE_DISCOVERY'):
  <%static:js group='discovery'/>
  % endif
</%block>

<%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)
%>

<section class="find-courses">

  <header class="search">
    <div class="inner-wrapper main-search">
      <hgroup>
        <div class="logo">
          <img src="${logo_file}" alt="${logo_alt_text}" style="display: none" />
          <img src="${static.url('themes/memooc/images/MeMOOC/logo_memooc.png')}" alt="${logo_alt_text}" />
        </div>
        <h2>${course_index_overlay_text}</h2>
      </hgroup>
    </div>
  </header>

  <section class="courses-container">

    % if course_discovery_enabled:
		<div id="discovery-form" role="search" aria-label="course">
		  <form>
			<input class="discovery-input" placeholder="${_('Search for a course')}" type="text"/><!-- removes spacing
			--><button type="submit" class="button postfix discovery-submit" aria-label="${_('Search')}">
			  <i class="icon fa fa-search" aria-hidden="true"></i>
			</button>
		  </form>
		  <div id="discovery-message"></div>
		  <div aria-live="polite" aria-relevant="all">
			<div id="loading-indicator" class="hidden">
			  <i class="icon fa fa-spinner fa-spin"></i> ${_('Loading')}
			</div>
		  </div>
		</div>

		<div id="filter-bar" class="filters hide-phone">
		</div>
    % endif

    <section class="courses${'' if course_discovery_enabled else ' no-course-discovery'}">
		<h1 class="title">${_('Courses')}</h1>
		<div class="row">
			<div class="col-xs-12 visible-xs-block">
				<a class="btn btn-primary btn-lg btn-block" href="#filter_box">${_("Go to filter")}</a>
			</div>
			<div class="col-xs-12 col-sm-10 col-md-10">
				<ul class="courses-listing row">
					%for course in courses:
						<li class="courses-listing-item0 col-xs-12 col-sm-6 col-md-4 parent_staus">
						  <%include file="../course.html" args="course=course" />
						</li>
					%endfor
				</ul>
			</div>
			<div id="filter_box" class="col-xs-12 col-sm-2 col-md-2" style="background-color: rgba(235, 246, 252, 0.75);">
				<h2>${_("Filter")}</h2>
				<input id="search_title" class="btn_border" value="" placeholder="${_("Title")}" />
				%for key in filter_conf.keys():
					## ${filter_conf[key]}
					<% filter = filter_conf[key] %>
					<section class="filter_box">
						 <%include file="../filter.html" args="key=key, filter=filter" />
					</section>
				%endfor
			</div>
			<script>
				$( "#search_title" ).keydown(function(event) {
					setTimeout(function(){
						$('.course_info .course-title').each(function( index, element ) {
							var search_text = $("#search_title").attr('value').toLowerCase();
							var display_val = 'block';

							if ($(element).html().toLowerCase().indexOf(search_text) == -1) {
								display_val = 'none';
							}
							$(this).closest('.parent_staus').css('display', display_val);
						})
					}, 500);
				});
				%if 'search_text' in req_POST:
					var $st = $('#search_title');
					$st.focus();
					$st.attr('value', "${req_POST['search_text']}");
					var e = jQuery.Event("keydown");
					e.which = 13; // # Some key code value
					$st.trigger(e);
				%endif
			</script>
		</div><commit_msg>switching dict to list<commit_after><%!
  import json
  from django.utils.translation import ugettext as _
  from microsite_configuration import microsite
%>
<%inherit file="../main.html" />

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

<%block name="header_extras">
  % if settings.FEATURES.get('ENABLE_COURSE_DISCOVERY'):
  % for template_name in ["result_item", "filter_bar", "filter", "search_facets_list", "search_facets_section", "search_facet", "more_less_links"]:
  <script type="text/template" id="${template_name}-tpl">
      <%static:include path="discovery/${template_name}.underscore" />
  </script>
  % endfor
  <script type="text/javascript">;(function (define) {{
      define('course_discovery_meanings', function() {{
          'use strict';
          return ${json.dumps(course_discovery_meanings)};
        }});
      }})(define || RequireJS.define);
  </script>
  % endif
</%block>

<%block name="js_extra">
  % if settings.FEATURES.get('ENABLE_COURSE_DISCOVERY'):
  <%static:js group='discovery'/>
  % endif
</%block>

<%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)
%>

<section class="find-courses">

  <header class="search">
    <div class="inner-wrapper main-search">
      <hgroup>
        <div class="logo">
          <img src="${logo_file}" alt="${logo_alt_text}" style="display: none" />
          <img src="${static.url('themes/memooc/images/MeMOOC/logo_memooc.png')}" alt="${logo_alt_text}" />
        </div>
        <h2>${course_index_overlay_text}</h2>
      </hgroup>
    </div>
  </header>

  <section class="courses-container">

    % if course_discovery_enabled:
		<div id="discovery-form" role="search" aria-label="course">
		  <form>
			<input class="discovery-input" placeholder="${_('Search for a course')}" type="text"/><!-- removes spacing
			--><button type="submit" class="button postfix discovery-submit" aria-label="${_('Search')}">
			  <i class="icon fa fa-search" aria-hidden="true"></i>
			</button>
		  </form>
		  <div id="discovery-message"></div>
		  <div aria-live="polite" aria-relevant="all">
			<div id="loading-indicator" class="hidden">
			  <i class="icon fa fa-spinner fa-spin"></i> ${_('Loading')}
			</div>
		  </div>
		</div>

		<div id="filter-bar" class="filters hide-phone">
		</div>
    % endif

    <section class="courses${'' if course_discovery_enabled else ' no-course-discovery'}">
		<h1 class="title">${_('Courses')}</h1>
		<div class="row">
			<div class="col-xs-12 visible-xs-block">
				<a class="btn btn-primary btn-lg btn-block" href="#filter_box">${_("Go to filter")}</a>
			</div>
			<div class="col-xs-12 col-sm-10 col-md-10">
				<ul class="courses-listing row">
					%for course in courses:
						<li class="courses-listing-item0 col-xs-12 col-sm-6 col-md-4 parent_status">
						  <%include file="../course.html" args="course=course" />
						</li>
					%endfor
				</ul>
			</div>
			<div id="filter_box" class="col-xs-12 col-sm-2 col-md-2" style="background-color: rgba(235, 246, 252, 0.75);">
				<h2>${_("Filter")}</h2>
				<input id="search_title" class="btn_border" value="" placeholder="${_("Title")}" />
				%for item in filter_conf:
					## ${filter_conf[key]}
					<% filter = item[1] %>
					<section class="filter_box">
						 <%include file="../filter.html" args="key=item[0], filter=filter" />
					</section>
				%endfor
			</div>
			<script>
				$( "#search_title" ).keydown(function(event) {
					setTimeout(function(){
						$('.course_info .course-title').each(function( index, element ) {
							var search_text = $("#search_title").attr('value').toLowerCase();
							var display_val = 'block';

							if ($(element).html().toLowerCase().indexOf(search_text) == -1) {
								display_val = 'none';
							}
							$(this).closest('.parent_status').css('display', display_val);
						})
					}, 500);
				});
				%if 'search_text' in req_POST:
					var $st = $('#search_title');
					$st.focus();
					$st.attr('value', "${req_POST['search_text']}");
					var e = jQuery.Event("keydown");
					e.which = 13; // # Some key code value
					$st.trigger(e);
				%endif
			</script>
		</div>
{'fraction_non_alphanumeric': 0.1852170587110346, 'fraction_numerical': 0.008032128514056224, 'mean_word_length': 3.826488232579603, 'pattern_counts': {'":': 0, '<': 157, '<?xml version=': 0, '>': 157, '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': '1988341', 'n_tokens_mistral': 4060, 'n_tokens_neox': 3517, 'n_words': 628}