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

<p style="{font-weight:bold; font-size:larger; color:red;}"
      tal:define="err_msg request/err_msg|options/err_msg|nothing"
      tal:condition="err_msg"
      tal:content="string: *** ${err_msg} *** ">
  Some Error
</p>


<h2 tal:define="global tracker here/getTracker;
                global issue_url here/absolute_url">
  <a href="" id="jtracker_title"
     tal:attributes="href string:${tracker/absolute_url}/"
     tal:content="string:${tracker/title} (${tracker/abbreviation})">
    My Tracker
  </a> - <a href="" id="issue_id"
            tal:attributes="href issue_url"
            tal:content="here/getId"> 127 </a>

</h2>

<table cellpadding="2" width="98%"
       tal:define="global isAdmin python: user.has_permission('Manage JTracker', here);
                   saved_search python: tracker.hasSearch(request)">

  <tr>
    <td colspan="2" align="left" valign="top" bgcolor="#e7e7e7">
      <b id="issue_title"
         tal:content="string: ${here/title} -- ${here/stage}"> 
        Some Title -- Stage
      </b><br />
      <b tal:condition="isAdmin|nothing">
          [&nbsp;<a href="" 
                    tal:attributes="href string:${issue_url}/manage_main">
                    Manage issue
                 </a>&nbsp;]
      </b>&nbsp;&nbsp;
      <b tal:condition="saved_search|nothing">
          [&nbsp;<a href=""
                    tal:define="qs python: tracker.getSearch(request);
                                t_url tracker/absolute_url"
                    tal:attributes="href python: '%s?%s' % (t_url, qs)">
                    Back to Search Results
                 </a>&nbsp;]
      </b>
    </td>
  </tr>

  <tr>
    <td><b> Request </b></td>
    <td tal:define="rn here/requester_name;
                    re here/requester_email;
                    rs python: isAdmin and '%s (%s)' % (rn, re) or rn"
        tal:content="string:${here/component} -- ${here/request_type} -- by ${rs}">
      XYZ-Product -- Bug Report
    </td>
  </tr>

  <tr>
    <td><b> Posted on </b></td>
    <td tal:content="here/request_date/aCommon">
      Friday, July 5 2001
    </td>
  </tr>

</table>

<form method="post" action="manage_subscribe"
      tal:condition="not: isAdmin|nothing">
  <table cellpadding="2" width="98%">
    <tr>
      <td>
        <input type="text" name="email" size="30" value=""
               tal:attributes="value request/email|nothing">&nbsp;
        <input type="submit" value=" Subscribe ">
      </td>
    </tr>
    <tr>
      <td style="{font-size:smaller}">
        Enter your email address to receive mail on every change to this issue.
      </td>
    </tr>
  </table>
</form>
<br /><br />

<div tal:define="replies here/getReplies"
     tal:condition="replies">

  <table width="98%" cellpadding="2" cellspacing="0" border="0">
    <tr>
      <td align="left" valign="top" bgcolor="#e7e7e7">
        <b>
          Entries (Latest first)&nbsp;&nbsp;
          [&nbsp;<a href="" tal:attributes="href string:${issue_url}/addReplyForm">
             Add new Entry
          </a>&nbsp;]&nbsp;
          [&nbsp;<a href=""
                    tal:condition="python: user.getUserName() == 'Anonymous User'"
                    tal:attributes="href string:${tracker/absolute_url}/forceLogin?came_from=${issue_url}">
              Log In
          </a>
          <span tal:condition="python: user.getUserName() != 'Anonymous User'"
                tal:replace="user/getUserName">
            Logged in as Some User
          </span>&nbsp;]
        </b>
      </td>
    </tr>
  </table>

  <br />

  <div tal:repeat="reply replies">

    <table width="98%" cellpadding="2" cellspacing="0" border="0">
      <tr tal:condition="repeat/reply/index">
        <td width="40">&nbsp;</td>
        <td>
          <br />
          <hr width="50%" align="left">
        </td>
      </tr>
      <tr>
        <td width="40">&nbsp;</td>
        <td>
          <b tal:define="rt reply/reply_type;
                         rm reply/requester_name">
            <span tal:replace="string: ${rt} by ${rm}">
              Request by Someone on 2002/12/02
            </span>
            <span tal:condition="isAdmin"
                  tal:replace="string: (${reply/requester_email})">
              xyz@mail.com
            </span>
            <span tal:replace="string:on ${reply/reply_date/aCommon}">
              Friday, June 22nd, 1999
            </span>
          </b>
        </td>
      </tr>
      <tr tal:condition="reply/file_name|nothing">
        <td width="40">&nbsp;</td>
        <td tal:define="file_ob python: here.getFile(reply.get('file_name'))">
          <b style="font-size: small">
            Attachment
            <a href=""
               tal:attributes="href string:${issue_url}/${reply/file_name}"
               tal:content="reply/file_name">
              attach.doc
            </a>
            <span tal:content="python: '(%i KB)' % (file_ob.get_size()/1024)">
              99 KB
            </span>
          </b>
        </td>
      </tr>
      <tr>
        <td width="40">&nbsp;</td>
        <td tal:define="pss modules/Products.PythonScripts.standard;
                        reply_body reply/description;
                        quoted_body python: pss.html_quote(reply_body);
                        newlined_body python: pss.newline_to_br(quoted_body)">
          <tt tal:content="structure newlined_body">
            Safe description
          </tt>
        </td>
      </tr>
    </table>

  </div>

</div>

<p tal:condition="not: here/getReplies">
  <b>No followups filed</b>&nbsp;&nbsp;
  <b>
    [<a href="" tal:attributes="href string:${issue_url}/addReplyForm">
       Add new Entry
     </a>]
  </b>
</p>

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

