<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html
  xmlns="http://www.w3.org/1999/xhtml"
  xmlns:i18n="http://genshi.edgewall.org/i18n"
  xmlns:py="http://genshi.edgewall.org/"
  xmlns:xi="http://www.w3.org/2001/XInclude"
  >

<xi:include href="_util.html" />

<head>
  <title>${page_title()} - ${g.site_title}</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <link rel="shortcut icon" href="${g.favicon}" type="image/x-icon" />
  <py:choose>
  <py:when test="defined('optional_feed')">
    ${optional_feed()}
  </py:when>
  <py:otherwise>
  <link rel="alternate" type="application/atom+xml" title="${g.site_title} - Recent Revision History" href="${h.url_for(controller='revision', action='list', id=None, format='atom', days=1)}" />
  </py:otherwise>
  </py:choose>

  <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.11/themes/ui-lightness/jquery-ui.css" type="text/css" media="screen, print" />
  <link rel="stylesheet" href="${g.site_url}/css/style.css" type="text/css" media="screen, print" />

  <!--[if IE]>
  <link rel="stylesheet" href="${g.site_url}/css/ie.css" type="text/css" media="screen, print" />
  <![endif]-->
  
  <script type="text/javascript" src="${g.site_url}/language.js"></script>
  <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
  <script type="text/javascript" src="http://assets.okfn.org/ext/jquery.cookie/jquery.cookie.min.js"></script>
  <script type="text/javascript" src="http://assets.okfn.org/ext/jquery.placeholder/jquery.placeholder.js"></script>
  <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.11/jquery-ui.min.js"></script>
  <script type="text/javascript" src="${g.site_url}/scripts/application.js?lang=${c.locale}"></script>
  
  <script type="text/javascript">
    $(document).ready(function() {
        var ckan_user = $.cookie("ckan_display_name");
        if (ckan_user) {
            $(".ckan-logged-out").hide();
            $(".ckan-logged-in").show();
        }
        $('input[placeholder], textarea[placeholder]').placeholder();
    });
  </script>
  <py:if test="defined('optional_head')">
    ${optional_head()}
  </py:if>
</head>

<body class="${value_of('body_class', default=lambda: c.body_class)()}">

<div id="wrapper" class="hfeed">
  <div id="header">
  <div id="masthead">
    <div id="branding" role="banner">
       <h1 id="site-title">
       <a href="${url('home')}" title="${g.site_title} Home">
      <py:if test="g.site_logo">
            <img src="${g.site_logo}" alt="${g.site_title} Logo" title="${g.site_title} Logo" style="display: inline;" />
          </py:if>
          <py:if test="not g.site_logo">
            ${g.site_title}
          </py:if>
        </a>
      </h1>
      <div id="site-description">${g.site_description}</div>
    </div> <!-- /branding -->

    <div id="top-bar">
      <div id="top-bar-login">
        <span class="ckan-logged-in" style="display: none;">
          <a href="${h.url_for(controller='user',action='me',id=None)}">${h.icon('user')} My account</a>
          &middot; <a href="${h.url_for('/user/logout')}">Logout</a>
        </span>
        <span class="ckan-logged-out">
                <a href="${h.url_for(controller='user',action='login', id=None)}">Login</a> &middot;
                <a href="${h.url_for(controller='user',action='register', id=None)}">Register</a>
        </span>
      </div>

      <div class="search-form">
        <form action="${url(controller='package', action='search')}" method="GET">
          <input type="search" class="search" name="q" value="" autocomplete="off" results="5" placeholder="Search..."/>
        </form>
      </div>
    </div><!-- /top-bar -->

    <div id="access" role="navigation">
      <div class="skip-link screen-reader-text">
        <a href="#content" title="Skip to content">Skip to content</a>
      </div> 
      <div class="menu">
        <ul>
          <li>${h.nav_link(c, _('Home'), controller='home', action='index', id=None)}</li>
          <li>${h.nav_link(c, _('Search'), controller='package', action='index', id=None, highlight_actions = 'search index')}</li>
<?python
    am_authorized_package_create = h.am_authorized(c, actions.PACKAGE_CREATE)
?>
          <li py:if="am_authorized_package_create">${h.nav_link(c, _('Add a package'), controller='package', action='new', id=None)}</li>
          <li>${h.nav_link(c, _('Tags'), controller='tag', action='index', id=None)}</li>
          <li>${h.nav_link(c, _('Groups'), controller='group', action='index', id=None, highlight_actions = 'new index')}</li>
          <li>${h.nav_link(c, _('About'), controller='home', action='about', id=None)}</li>
      </ul>
      </div> <!-- .menu -->
    </div> <!-- #access -->

  </div><!-- #masthead -->
  </div><!-- #header -->  

  <div id="main"> 
  <py:with vars="messages = list(h._flash.pop_messages())">
  <div class="flash-banner-box" py:if="len(messages)">
    <div class="flash-banner ${m.category}" py:for="m in messages">
      ${m.message}
    </div>
  </div>
  </py:with>

    <div id="container"> 
      <div id="minornavigation">
        <minornavigation></minornavigation> 
      </div>
      <div id="content" role="main"> 
        <div class="page type-page hentry">
          <div class="entry-content">
            <!-- support both options for defining content -->
            <py:if test="defined('content')">
            ${content()}
            </py:if>
            <content>
                <p>Master content template placeholder &hellip; please replace me.</p>
            </content>
          </div><!-- .entry-content -->
        </div>

        <div id="comments">
        </div><!-- #comments -->

      </div> <!-- #content -->
    </div> <!-- #container -->

    <div id="primary" class="widget-area" role="complementary">
      <ul class="xoxo">
        <py:if test="defined('primary_sidebar_extras')">
          ${primary_sidebar_extras()}
        </py:if>
        <primarysidebar>
        <!-- Primary Side Bar Goes Here -->
        </primarysidebar>
      </ul>
    </div><!-- #primary .widget-area -->

  </div><!-- #main -->
  
<div id="footer" role="contentinfo"> 
  <div id="colophon">
    <div id="footer-widget-area" role="complementary">

      <div id="first" class="widget-area">
        <ul class="xoxo">
          <li class="widget-container widget_text">
          <h3 class="widget-title">Packages</h3>
          <div class="textwidget">
            <ul>
                <li>${h.nav_link(c, _('Search'), controller='package', action='search', id=None)}</li>                
                <li py:if="am_authorized_package_create">${h.nav_link(c, _('Register a new Package'), controller='package', action='new', id=None)}</li>
                <li>${h.nav_link(c, _('Revision History'), controller='revision', action='index', id=None)}</li>
                <li>${h.link_to(_('API'), h.url_for(controller='api', action='get_api', id=None))}</li>
                <li>${h.link_to(_('API Docs'), 'http://wiki.ckan.net/API')}</li>
<?python
  from pylons import config
  dumps_url = config.get('ckan.dumps_url')
  dumps_format = config.get('ckan.dumps_format', '')
?>
                <li py:if="dumps_url">${h.link_to(_('Full %s dump') % dumps_format, dumps_url)}</li>
            </ul>
          </div>
          </li>
        </ul>
        <ul class="xoxo">
          <li class="widget-container widget_text">
          <h3 class="widget-title">Groups &amp; Tags</h3>
          <div class="textwidget">
            <ul>
              <li>${h.nav_link(c, _('Tags'), controller='tag', action='index', id=None)}</li>
              <li>${h.nav_link(c, _('Groups'), controller='group', action='index', id=None)}</li>
              <li py:if="h.am_authorized(c, actions.GROUP_CREATE)">${h.nav_link(c, _('Create a new Group'), controller='group', action='new', id=None)}</li>
              <li>${h.nav_link(c, _('Authorization Groups'), controller='authorization_group', action='index', id=None)}</li>
              <li class="page_item" py:if="h.am_authorized(c, actions.AUTHZ_GROUP_CREATE)">${h.nav_link(c, _('Create a new Authorization Group'), controller='authorization_group', action='new', id=None)}</li>
            </ul>
          </div>
          </li>
        </ul>
        <ul class="xoxo">
          <li class="widget-container widget_text">
          <h3 class="widget-title">About</h3>
          <div class="textwidget">
            <ul>
              <li>
                <a href="http://ckan.org/">Project Home Page</a>
              </li>
              <li>
                <a href="http://www.okfn.org/contact/">Contact Us</a>
              </li>
              <li>
                <a href="http://www.okfn.org/privacy-policy/">Privacy Policy</a>
              </li>
            </ul>
          </div>
          </li>
        </ul>
        <ul class="xoxo">
          <li class="widget-container widget_text">
          <h3 class="widget-title">Language</h3>
          <div class="textwidget">
            <ul>
<?python
  import ckan.lib.hash
  current_url = url.current().encode('utf-8')
  current_url_hash = ckan.lib.hash.get_message_hash(current_url)
?>
              <li py:for="locale in h.get_available_locales()">
              <a href="${url(controller='home', action='locale', 
                             locale=str(locale), 
                             return_to=current_url,
                             hash=current_url_hash)}">
                  ${locale.display_name}
                </a>
              </li>
            </ul>
          </div>
          </li>
        </ul>
      </div><!-- #first .widget-area -->

      <div id="fourth" class="widget-area">
        <ul class="xoxo">
          <li class="widget-container widget_text">
          <h3 class="widget-title">Credits</h3>
          <div class="textwidget">
            <ul>
              <li i18n:msg="">
                <img src="http://assets.okfn.org/images/logo/okf_logo_white_and_green_tiny.png" id="footer-okf-logo" />
                An
                <a href="http://www.okfn.org/">Open Knowledge Foundation</a> Project
              </li>
              <li>
                &copy; <a href="http://www.okfn.org/">Open Knowledge Foundation</a>
              </li>
              <li>
                <a href="http://www.opendefinition.org/okd/">
                <img alt="This Content and Data is Open" src="http://assets.okfn.org/images/ok_buttons/oc_80x15_blue.png" style="border: none ; margin-bottom: -4px;"/>
                </a>
              </li>
              <li>
                <a href="http://www.opendefinition.org/okd/">
                <img alt="This Content and Data is Open" src="http://assets.okfn.org/images/ok_buttons/od_80x15_blue.png" style="border: none ; margin-bottom: -4px;"/>
                </a>
              </li>
            </ul>
          </div>
          </li>
        </ul>
      </div><!-- #fourth .widget-area -->

    </div><!-- #footer-widget-area -->

    <div id="site-info">
      <a href="${url('/')}" title="${g.site_title}" rel="home">
        ${g.site_title}</a>
    </div><!-- #site-info -->

    <div id="site-generator">
      <a href="http://ckan.org/"
        title="CKAN" rel="generator">
        Powered by CKAN
        <span i18n:msg="version">
          v${c.__version__}
        </span>
      </a>
    </div><!-- #site-generator -->
  </div><!-- #colophon -->
</div><!-- #footer --> 

</div><!-- #wrapper -->

${h.literal(getattr(g, 'template_footer_end', ''))}
</body>
</html>
