<html xmlns:py="http://genshi.edgewall.org/"
  xmlns:i18n="http://genshi.edgewall.org/i18n"
  xmlns:xi="http://www.w3.org/2001/XInclude"
  py:strip="">
  
  <py:def function="page_title">Welcome</py:def>
  <py:def function="body_class">hide-sidebar</py:def>

    <div py:match="//div[@id='content']" class="front-page">
      <div class="span-24 last">
        <h1>Welcome to ${g.site_title}!</h1>
      </div>
      <div class="span-8 action-box">
        <div class="action-box-inner find">
          <h1>Find data</h1>

          <form action="${h.url_for(controller='package', action='index')}" method="GET"> 
            <input name="q" value="" class="search-field" placeholder="${_('Find datasets')}" /> 
          </form> 
          ${g.site_title} contains <a href="${h.url_for(controller='package')}">${c.package_count} datasets</a> that you can 
          browse, learn about and download. 
        </div>
      </div>
      <div class="span-8 action-box">
        <div class="action-box-inner share">
        <h1>Share data</h1>

        Add your own datasets to share them with others and
        to find other people interested in your data.
        
        <py:choose test="h.am_authorized(c, actions.PACKAGE_CREATE)">
          <a py:when="" href="${h.url_for(controller='package', action='new')}" class="create-button">Create a dataset &raquo;</a>
          <py:otherwise>
            <a href="${h.url_for(controller='user', action='login')}" class="create-button">Sign up &raquo;</a>
          </py:otherwise>
        </py:choose>
        </div>
      </div>
      <div class="span-8 last action-box">
        <div class="action-box-inner collaborate">
        <h1>Collaborate</h1>

        Find out more about working with open data by exploring 
        these resources: 
        <ul>
          <li><a href="http://getthedata.org">GetTheData.org</a></li>
          <li><a href="http://datapatterns.org">DataPatterns.org</a></li>
          <li><a href="http://opendatamanual.org">Open Data Manual</a></li>
        </ul>
        </div>
      </div>
      <div py:if="c.groups" class="span-24 last whoelse">
        <h2>Who else is here?</h2>
      </div>
      <py:for each="i, group_dict in enumerate(c.groups[:6])">
        <div class="span-8 group ${'last' if i % 3 == 2 else ''}">
          <h3><a href="${h.url_for(controller='group', action='read', id=group_dict['name'])}">${group_dict['title']}</a></h3>
          <p>
            ${h.markdown_extract(group_dict['description'])}
          </p>
          <strong>${group_dict['title']} has ${group_dict['packages']} datasets.</strong>
        </div>
      </py:for>
  </div>
  <xi:include href="layout.html" />
</html>

