<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--[if IE 8 ]>    <html class="no-js ie8" lang="en"> <![endif]-->
  <!--[if (gte IE 9)|!(IE)]><!--> <html class="no-js" lang="en"
      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"
      > <!--<![endif]-->
<xi:include href="_util.html" />
<head>
  <meta charset="utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />

  <title>${page_title()} - ${g.site_title}</title>
  <meta name="description" content="" />
  <meta name="author" content="" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <link rel="shortcut icon" href="${g.site_url}/favicon.ico" />

  <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 href='http://fonts.googleapis.com/css?family=Ubuntu' rel='stylesheet' type='text/css' />

  <link rel="stylesheet" href="${g.site_url}/scripts/vendor/jqueryui/1.8.14/css/jquery-ui.custom.css" type="text/css" media="screen, print" />
  <link rel="stylesheet" href="${g.site_url}/css/boilerplate.css?v=2" />
  <link rel="stylesheet" href="${g.site_url}/css/blueprint/screen.css" type="text/css" media="screen, projection" />
  <link rel="stylesheet" href="${g.site_url}/css/blueprint/print.css" type="text/css" media="print" />
  <!--[if lt IE 8]>
    <link rel="stylesheet" href="${g.site_url}/css/blueprint/ie.css" type="text/css" media="screen, projection">
  <![endif]-->
  <link rel="stylesheet" href="${g.site_url}/css/style.css?v=2" />

  <py:if test="defined('optional_head')">
    ${optional_head()}
  </py:if>

  ${h.literal(getattr(g, 'template_head_end', ''))}
</head>

<body class="${request.environ.get('pylons.routes_dict', {}).get('action')} 
             ${request.environ.get('pylons.routes_dict', {}).get('controller').split(':')[-1]}">
   <div class="welcome-banner js-welcome-banner" style="display: none;">
     <span>First time at ${g.site_title}? Visit our <a href="${h.url_for(controller='home', action='about')}">About page</a> to find out more.</span>
     <button class="pretty-button js-kill-button">x</button>
  </div>
  <div id="wrap">
    <div class="header outer">
      <header class="container">
        <div class="menu account">
          <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>
            <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>
            <a href="${h.url_for(controller='user',action='register', id=None)}">Register</a>
          </span>
        </div>
        <a href="${url('home')}">
          <img width="64" src="${g.site_logo}" alt="${g.site_title} Logo" title="${g.site_title} Logo" id="logo" />
        </a>
        <div id="site-name">
          <a href="${url('home')}">${g.site_title} &mdash; ${g.site_description}</a>
        </div>
        <div class="menu">
          <span id="menusearch">
            <form action="${url(controller='package', action='search')}" method="GET">
              <input name="q" value="${c.q if hasattr(c, 'q') else ''}" class="search" placeholder="${_('Find datasets')}" />
            </form>
          </span>
          <div id="mainmenu">
            <span py:if="h.check_access('package_create')">${h.nav_link(c, _('Add a dataset'), controller='package', action='new', id=None)}</span>
            ${h.nav_link(c, _('Search'), controller='package', action='index', id=None, highlight_actions = 'new index')}
            ${h.nav_link(c, _('Groups'), controller='group', action='index', id=None)}
          </div>
          ${h.nav_link(c, _('About'), controller='home', action='about', id=None)}
        </div>
      </header>
    </div>
    <py:with vars="messages = list(h._flash.pop_messages())">
    <div class="flash-messages container">
      <div class="${m.category}" py:for="m in messages">
        ${h.literal(m)}
      </div>
    </div>
    </py:with>

    <div id="main" class="container" role="main">
      <h1 py:if="defined('page_heading')" class="page_heading">${page_heading()}</h1>
      <div id="minornavigation" class="span-24 last">
          <minornavigation></minornavigation>
      </div>

      <div id="content" class="span-16 append-1">
        <py:if test="defined('content')">
          ${content()}
        </py:if>
        <content>
          <p>Master content template placeholder &hellip; please replace me.</p>
        </content>
      </div> <!-- /content -->
      <div id="sidebar" class="span-7 last">
        <ul class="widget-list">
          <py:if test="defined('primary_sidebar_extras')">
            ${primary_sidebar_extras()}
          </py:if>
          <primarysidebar>
            <!-- Primary Side Bar Goes Here -->
          </primarysidebar>
        </ul>
      </div>
    </div>
    <br/><br/>
    <div id="push"></div>
  </div>
  <div class="footer outer">
    <footer class="container">
        <div class="xoxo span-6">
          <h3 class="widget-title">About ${g.site_title}</h3>
          <div class="textwidget">
            <ul>
                <li>${h.link_to(_('About'), h.url_for(controller='home', action='about', id=None))}</li>
              <li>
                <a href="http://twitter.com/ckanproject">Twitter @ckanproject</a>
              </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>
              <li>
                <a href="http://okfn.org/contact/">Contact Us</a>
              </li>
              <li>
                <a href="http://okfn.org/privacy-policy/">Privacy Policy</a>
              </li>
            </ul>
          </div>
        </div>
        <div class="xoxo span-6">
          <h3 class="widget-title">Sections</h3>
          <div class="textwidget">
            <ul>
              <li>
                <a href="${url(controller='user', action='index')}">
                  Users
                </a>
              </li>
              <li>
                <a href="${url(controller='tag', action='index')}">
                  Tags
                </a>
              </li>
              <li>
                <a href="${url(controller='revision', action='index')}">
                  Revisions
                </a>
              </li>
              <li>
                <a href="${url(controller='authorization_group', action='index')}">
                  Authorization Groups
                </a>
              </li>
              <li>
                <a href="${h.url_for('ckanadmin_index')}">
                  Site Admin
                </a>
              </li>
            </ul>
          </div>
        </div>
        <div class="xoxo span-6">
          <h3 class="widget-title">Languages</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 or locale.english_name}
                </a>
              </li>
            </ul>
          </div>
        </div>
        <div class="xoxo span-6 last">
          <h3 class="widget-title">Meta</h3>
          <p id="credits">
          &copy; 2011
        <img src="http://assets.okfn.org/images/logo/okf_logo_white_and_green_tiny.png" id="footer-okf-logo" />
        <a href="http://okfn.org/">Open Knowledge Foundation</a>
        Licensed under the <a href="http://opendatacommons.org/licenses/odbl/1.0/">Open Database License</a>
        <a href="http://opendefinition.org/"><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>
        
        <br/><br/>
        Powered by <a href="http://ckan.org">CKAN</a> v${c.__version__}.<br/>
      </p>
        </div>
    </footer>
  </div> <!-- eo #container -->


  <!--script
  src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script-->
  <script src="${g.site_url}/scripts/vendor/jquery/1.6.2/jquery.js"></script>
  <script type="text/javascript" src="${g.site_url}/scripts/vendor/json2.js"></script>
  <script type="text/javascript" src="${g.site_url}/scripts/vendor/jquery.tmpl/beta1/jquery.tmpl.js"></script>
  <script type="text/javascript" src="${g.site_url}/scripts/vendor/jquery.cookie/jquery.cookie.min.js"></script>
  <script type="text/javascript" src="${g.site_url}/scripts/vendor/jquery.placeholder/jquery.placeholder.js"></script>
  <script type="text/javascript" src="${g.site_url}/scripts/vendor/jqueryui/1.8.14/jquery-ui.min.js"></script>
  <!-- for ckanjs etc -->
  <script type="text/javascript" src="${g.site_url}/scripts/vendor/underscore/1.1.6/underscore.js"></script>
  <script type="text/javascript" src="${g.site_url}/scripts/vendor/backbone/0.5.1/backbone.js"></script>
  <script type="text/javascript" src="${g.site_url}/scripts/vendor/jquery.fileupload/20110801/jquery.iframe-transport.js"></script>
  <script type="text/javascript" src="${g.site_url}/scripts/vendor/jquery.fileupload/20110801/jquery.fileupload.js"></script>
  <script type="text/javascript" src="${g.site_url}/scripts/vendor/ckanjs/1.0.0/ckanjs.js"></script>
  <!-- Translated js strings live inside an html template. -->
  <xi:include href="js_strings.html" />
  <!-- finally our application js that sets everything up-->
  <script type="text/javascript" src="${g.site_url}/scripts/application.js?lang=${c.locale}"></script>
  <script type="text/javascript" src="${g.site_url}/scripts/templates.js"></script>

  <script src="${g.site_url}/scripts/vendor/modernizr/1.7/modernizr.min.js"></script>

  <script type="text/javascript">
    CKAN.plugins = [ 
      // Declare js array from Python string
      ${['\'%s\', '%s  for s in config.get('ckan.plugins','').split(' ')]}
    ];
    $(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_footer')">
    ${optional_footer()}
  </py:if>

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



