<h1 tal:replace="structure here/standard_html_header">Header</h1>

<span tal:omit-tag=""
      tal:condition="request/do_search|nothing">
  <span tal:omit-tag=""
        tal:define="global res python: here.catalog(REQUEST=request);
                    foo python: here.saveSearch(request)">
  </span>
</span>
<span omit-tag=""
      tal:condition="not: request/do_search|nothing">
  <span tal:omit-tag=""
        tal:define="global res python: here.catalog( stage=['Accepted', 'Pending']
                                                   , sort_on='id'
                                                   , sort_order='reverse'
                                                   )">
  </span>
</span>

<h2 tal:define="global total python: len(here.catalog.uniqueValuesFor('id'));
                pss modules/Products.PythonScripts.standard;
                res_len python: pss.thousands_commas(len(res))">
  <a href="" id="jtracker_title"
     tal:attributes="href string:${here/absolute_url}/">
    <span tal:replace="string:${here/title} (${here/abbreviation})">
      Tracker title
    </span>
  </a>&nbsp;-&nbsp;
  <span tal:replace="string: ${res_len} out of ${total} issues">
    10 out of 100
  </span>
</h2>

<p tal:content="here/description">
  Tracker Description
</p>

<div tal:define="b_start python:0;
                 b_start request/b_start | b_start;
                 Batch python:modules['ZTUtils'].Batch;
                 mq python:modules['ZTUtils'].make_query;
                 global batch python:Batch(res, 20, b_start, orphan=2);
                 my_url here/absolute_url;
                ">

  <table width="100%" cellpadding="2" cellspacing="0" border="0">
    <tr>
      <td align="left" valign="top" bgcolor="#e7e7e7">
        <b>
          <span tal:condition="python: user.has_permission('Submit JTracker Issues', here)">
            [&nbsp;<a href=""
                      tal:attributes="href string:${my_url}/addIssueForm">
               Add new issue
            </a>&nbsp;]&nbsp;
          </span>
          [&nbsp;<a href=""
                    tal:attributes="href string:${my_url}/searchForm">
             Search
          </a>&nbsp;]&nbsp;
          [&nbsp;<a href=""
                    tal:condition="python: user.getUserName() == 'Anonymous User'"
                    tal:attributes="href string:${my_url}/forceLogin?came_from=${my_url}">
              Log In
          </a>
          <span tal:condition="python: user.getUserName() != 'Anonymous User'"
                tal:replace="user/getUserName">
            Some User
          </span>&nbsp;]
        </b>
      </td>
      <td align="right" bgcolor="#e7e7e7" tal:condition="res">
        <span tal:define="p batch/previous" tal:condition="p">
          <a href=""
             tal:define="qs python: mq(request.form, b_start=p.first)"
             tal:attributes="href python: '%s/index_html?%s' % (my_url, qs)">
            << Previous
          </a>
        </span>&nbsp;&nbsp;
        <span tal:define="n batch/next" tal:condition="n">
          <a href=""
             tal:define="qs python: mq(request.form, b_start=n.first)"
             tal:attributes="href python: '%s/index_html?%s' % (my_url, qs)">
            Next >>
          </a>
        </span>&nbsp;&nbsp;
      </td>
    </tr>
  </table>

  <br />

  <table width="100%" cellpadding="2" cellspacing="3" border="0"
         tal:condition="res">

    <tr>
      <td><b> Title </b></td>
      <td><b> Request </b></td>
      <td><b> Date </b></td>
      <td><b> Stage </b></td>
    </tr>

    <tbody tal:repeat="brain batch">
      <tr>
        <td valign="top">
          <a href=""
             tal:attributes="href string:${my_url}/${brain/id}"
             tal:content="python: brain.title or brain.id">
            Some Issue
          </a>
        </td>
        <td nowrap valign="top">
          <span style="{font-size:smaller}">
            <span tal:replace="brain/component">
              XYZ Product
            </span>
            <br />
            <span tal:replace="brain/request_type">
              Feature Request
            </span>
            <span tal:replace="string: (${brain/followups} entries)">
              7 followups
            </span>
          </span>
        </td>
        <td nowrap valign="top" tal:content="brain/date">
          1999/12/12
        </td>
        <td valign="top" tal:content="brain/stage"> Stage </td>
      </tr>
    </tbody>
  
  </table>

</div>

<h1 tal:replace="structure here/standard_html_footer">Footer</h1>

