<%! from django.core.urlresolvers import reverse %>
<%! from time import strftime %>
<%inherit file="main.html" />
<%namespace name='static' file='static_content.html'/>

<section class="home">
  <header>
    <div class="outer-wrapper">
      <div class="title">
        <hgroup>
          <h1>The Future of Online Education</h1>
          <h2>For anyone, anywhere, anytime</h2>
        </hgroup>

        <section class="actions">
          <div class="main-cta">
            <a href="#signup-modal" id="signup_action" class="find-courses" rel="leanModal">Sign Up</a>
          </div>

          <div class="secondary-actions">
            <div class="social-sharing">
              <div class="sharing-message">Stay up to date with all edX has to offer!</div>
              <a href="https://twitter.com/edXOnline" class="share">
                <img src="${static.url('images/social/twitter-sharing.png')}">
              </a>
              <a href="http://www.facebook.com/EdxOnline" class="share">
                <img src="${static.url('images/social/facebook-sharing.png')}">
              </a>
              <a href="https://plus.google.com/108235383044095082735/posts" class="share">
                <img src="${static.url('images/social/google-plus-sharing.png')}">
              </a>
            </div>
          </div>
        </section>
      </div>

        <a href="#video-modal" class="media" rel="leanModal">
          <div class="hero">
            <div class="play-intro"></div>
          </div>
        </a>

    </div>
  </header>

  <section class="container">
    <section class="highlighted-courses">
      <h2>Explore free courses from <span class="edx">edX</span> universities</h2>

      <section class="university-partners">
        <ol class="partners">
          <li class="partner mit">
            <a href="${reverse('university_profile', args=['MITx'])}">
              <img src="${static.url('images/university/mit/mit.png')}" />
              <div class="name">
                <span>MITx</span>
              </div>
            </a>
          </li>
          <li class="partner">
            <a href="${reverse('university_profile', args=['HarvardX'])}">
              <img src="${static.url('images/university/harvard/harvard.png')}" />
              <div class="name">
                <span>HarvardX</span>
              </div>
            </a>
          </li>
          <li class="partner last">
            <a href="${reverse('university_profile', args=['BerkeleyX'])}">
              <img src="${static.url('images/university/berkeley/berkeley.png')}" />
              <div class="name">
                <span>BerkeleyX</span>
              </div>
            </a>
          </li>
        </ol>
      </section>

      <section class="courses">
        <section class='university-column'>
          %for course in universities['MITx']:
            <%include file="course.html" args="course=course" />
          %endfor
        </section>
        <section class='university-column'>
          %for course in universities['HarvardX']:
            <%include file="course.html" args="course=course" />
          %endfor
        </section>
        <section class='university-column last'>
          %for course in universities['BerkeleyX']:
            <%include file="course.html" args="course=course" />
          %endfor
        </section>
      </section>
    </section>
  </section>

  <section class="container">
    <section class="more-info">
      <header>
        <h2><span class="edx">edX</span> News &amp; Announcements</h2>
      </header>
      <section class="news">
        <section class="blog-posts">
            %for entry in entries:
            <article>
                %if entry.image:
                    <a href="${entry.link}" class="post-graphics" target="_blank"><img src="${entry.image}" /></a>
                %endif
                <div class="post-name">
                    <a href="${entry.link}" target="_blank">${entry.title}</a>
                    %if entry.summary:
                        <p>${entry.summary}</p>
                    %endif
                    <p class="post-date">${strftime("%m/%d/%y", entry.published_parsed)}</p>
                </div>
            </article>
            %endfor
        </section>
        <section class="press-links">
          <h3>edX in the News:</h3>
          ##<a href="${reverse('press/mit-and-harvard-announce-edx')}">The edX Press Release</a>
          <a target="_blank" href="http://www.nytimes.com/2012/07/20/education/edlife/anant-agarwal-discusses-free-online-courses-offered-by-a-harvard-mit-partnership.html">New York Times</a>,
          <a target="_blank" href="http://www.bostonglobe.com/magazine/2012/07/14/anant-agarwal-believes-online-education-from-mit-and-harvard-should-available-all/Af0kX44dPqpBKRV2IOSjPP/story.html"target="_blank" >Boston Globe</a>,
          <a target="_blank" href="http://www.huffingtonpost.co.uk/2012/06/20/harvard-and-mit-create-edx-free-university-courses_n_1612143.html?utm_hp_ref=uk">Huffington Post</a>,
          <a target="_blank" href="http://gigaom.com/cloud/everybody-codes/">GigaOM</a>,
          <a target="_blank" href="http://web.mit.edu/newsoffice/2012/mitx-edx-first-course-recap-0716.html">MIT News</a>,
          ##<a target="_blank" href="http://spectrum.ieee.org/at-work/education/review-mitxs-online-circuit-design-and-analysis-course">IEEE Spectrum</a>,
          <a target="_blank" href="http://harvardmagazine.com/2012/07/harvard-extended">Harvard Magazine</a>,
          <a target="_blank" href="http://www.bloomberg.com/news/2012-07-24/berkeley-joins-harvard-mit-offering-free-online-classes.html">Bloomberg</a>
          ## <a target="_blank" href="http://chronicle.com/blogs/wiredcampus/uc-berkeley-joins-edx-effort-to-offer-free-open-courses/37969">The Chronicle of Higher Education</a>

          <a href="${reverse('press')}" class="read-more">Read More &rarr;</a>
        </section>
      </section>
    </section>
  </section>

</section>

<section id="video-modal" class="modal home-page-video-modal video-modal">
  <div class="inner-wrapper">
    <iframe width="640" height="360" src="http://www.youtube.com/embed/C2OQ51tu7W4?showinfo=0" frameborder="0" allowfullscreen></iframe>
  </div>
</section>

% if show_signup_immediately is not UNDEFINED:
<script type="text/javascript">
function dosignup(){
    comp = document.getElementById('signup_action');
try { //in firefox
    comp.click();
    return;
} catch(ex) {}
try { // in old chrome
    if(document.createEvent) {
        var e = document.createEvent('MouseEvents');
        e.initEvent( 'click', true, true );
        comp.dispatchEvent(e);
        return;
    }
} catch(ex) {}
try { // in IE, safari
    if(document.createEventObject) {
         var evObj = document.createEventObject();
         comp.fireEvent("onclick", evObj);
         return;
    }
} catch(ex) {}
}
$(window).load(dosignup);
</script>
% endif
