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

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

<%block name="pagetitle">${_("Courses")}</%block>
<%! from microsite_configuration import microsite %>

<section class="find-courses">

<%
  course_index_overlay_text = microsite.get_value('course_index_overlay_text', _("Explore free courses from leading universities."))

  # not sure why this is, but if I use static.url('images/edx_bw.png') then the HTML rendering
  # of this template goes wonky

  logo_file = microsite.get_value(
    'course_index_overlay_logo_file', settings.STATIC_URL + 'images/edx_bw.png')
%>

  <header class="search">
    <div class="inner-wrapper main-search">
      <hgroup>
        <div class="logo">
          % if self.stanford_theme_enabled():
            <img src="${static.url('themes/stanford/images/seal.png')}" alt="Stanford Seal Logo" />
          % else:
            <img src='${logo_file}' alt="${microsite.get_value('platform_name', settings.PLATFORM_NAME)} Logo" />
          % endif
        </div>
        % if self.stanford_theme_enabled():
          <h2>${_("Explore free courses from {university_name}.").format(university_name="Stanford University")}</h2>
        % else:
          <h2>${course_index_overlay_text}</h2>
        % endif
      </hgroup>
    </div>
  </header>

  <section class="container">
    <section class="courses">
      <ul class="courses-listing">
        %for course in courses:
        <li class="courses-listing-item">
          <%include file="../course.html" args="course=course" />
        </li>
        %endfor
      </ul>
    </section>
  </section>
</section>