<!-- Navigation -->
<div class="listingBar"
     metal:define-macro="navigation"
     tal:define="batch view/batch"
     tal:condition="batch/multiple_pages">
    <span class="previous"
      tal:condition="batch/has_previous">
        <a href=""
           tal:attributes="href string:${view/url}?pagenumber=${batch/previouspage}&state=${request/state}&sort_on=${request/sort_on|string:getObjPositionInCourse}">
           &laquo;
           <span i18n:translate="batch_previous_x_items" tal:omit-tag="">
               Previous
               <span i18n:name="number" tal:omit-tag="" tal:content="batch/pagesize">n</span>
               items
           </span>
        </a>
    </span>

    <span class="next"
          tal:condition="batch/has_next">
        <a href=""
           tal:attributes="href string:${view/url}?pagenumber=${batch/nextpage}&state=${request/state}&sort_on=${request/sort_on|string:getObjPositionInCourse}">
           <span i18n:translate="batch_next_x_items" tal:omit-tag="">
               Next
               <span i18n:name="number" tal:omit-tag="" tal:content="batch/next_item_count">n</span>
               items
           </span>
           &raquo;
        </a>
    </span>

    <!-- Link to first -->
    <span tal:condition="batch/show_link_to_first">
        <a href=""
           tal:attributes="href string:${view/url}?pagenumber=1&state=${request/state}&sort_on=${request/sort_on|string:getObjPositionInCourse}">1</a>
        <span tal:condition="batch/second_page_not_in_navlist"
              tal:omit-tag="">
           ...
        </span>
    </span>

    <!-- Pagelist with quantum leap links to previous pages for quick navigation -->
    <!--
    <span tal:repeat="linklist python:batch.navurls(request.form, batch.leapback)"
          tal:condition="batch/leapback"
          tal:omit-tag="" >
        <a href=""
           tal:define="page python:linklist[0];
                       query python:linklist[1];"
           tal:content="page"
           tal:attributes="href python: '%s?%s' % (url,query)" >
        </a>
        ...
    </span>
    -->

    <!-- Pagelist with links to previous pages for quick navigation -->
    <span tal:repeat="pagenumber batch/previous_pages"
          tal:omit-tag="" >
      <a href="" tal:content="pagenumber" 
         tal:attributes="href string:${view/url}?pagenumber=$pagenumber&state=${request/state}&sort_on=${request/sort_on|string:getObjPositionInCourse}"/>
    </span>

    <!-- Current page -->
    <span tal:condition="batch/navlist"
          tal:omit-tag="">
        [<span tal:content="batch/pagenumber">Current page number</span>]
    </span>

    <!-- Pagelist with links to next pages for quick navigation -->
    <span tal:repeat="pagenumber batch/next_pages"
          tal:omit-tag="" >
      <a href="" tal:content="pagenumber" 
         tal:attributes="href string:${view/url}?pagenumber=$pagenumber&state=${request/state}&sort_on=${request/sort_on|string:getObjPositionInCourse}"/>
    </span>

    <!-- Pagelist with quantum leap links to next pages for quick navigation -->
    <!--
    <span tal:repeat="linklist python:batch.navurls(request.form, batch.leapforward)"
          tal:condition="batch/leapforward"
          tal:omit-tag="" >
        ...
        <a href=""
           tal:define="page python:linklist[0];
                       query python:linklist[1];"
           tal:content="page"
           tal:attributes="href python: '%s?%s' % (url,query)" >
        </a>
    </span>
    -->

    <!-- Link to last -->
    <span tal:condition="batch/show_link_to_last">
        <span tal:condition="batch/before_last_page_not_in_navlist"
              tal:omit-tag="">
           ...
        </span>
        <a href=""
           tal:attributes="href string:${view/url}?pagenumber=${batch/lastpage}&state=${request/state}&sort_on=${request/sort_on|string:getObjPositionInCourse}"
           tal:content="batch/lastpage">3457</a>
    </span>
</div>
