[%# 1.0@bugzilla.org %][%# The contents of this file are subject to the Mozilla Public
  # License Version 1.1 (the "License"); you may not use this file
  # except in compliance with the License. You may obtain a copy of
  # the License at http://www.mozilla.org/MPL/
  #
  # Software distributed under the License is distributed on an "AS
  # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
  # implied. See the License for the specific language governing
  # rights and limitations under the License.
  #
  # The Original Code is the Bugzilla Test Runner System.
  #
  # The Initial Developer of the Original Code is Maciej Maczynski.
  # Portions created by Maciej Maczynski are Copyright (C) 2001
  # Maciej Maczynski. All Rights Reserved.
  #
  # Contributor(s): Ed Fuentetaja <efuentetaja@acm.org>
  #                 Greg Hendricks <ghendricks@novell.com>
  #%]

[%# We need to do this again since this may be called from ajax %]

[% PROCESS testopia/style.none.tmpl %]
[% PROCESS testopia/blocks.html.tmpl %]

[% IF table.list_count > 0 %]
[%# More than this will cause your browser to get really slow 
  # So we won't show the action and effects %]
[% SET MAX_LIMIT = 1000 %]

[% IF table.view_count >= MAX_LIMIT %]
<p><b>This list is too big to display quickly. Action and Effect will not be included.</b></p>
[% END %] 
<a href="javascript:coal()">Collapse All</a> |
<a href="javascript:exal()">Expand All</a> 
[% IF dotweak %]
Select:
<a href="javascript:sall()">All</a>,
<a href="javascript:snone()">None</a>
  [% END %]
  [% SET nav = { curr  => page,
               last  => pagecount }
  %]

  [% IF table.ajax %] 
    [% link = "javascript:updateCaseList(\'" %]
    [% paren = "\', $table.direction)" %]
  [% ELSE %]
    [% link = "${table.get_order_url}&order=" %]
    [%# link = "${table.url_loc}?reverse=${table.reverse_sort}&getlist=1&viewall=${table.viewall}&order=" %]
  [% END %]
  [% DECORATIVE_BORDER_100_BEGIN %] 

<table width="100%" id="ttt">
  <tr class="bz_row_header">
    <th colspan="2" align="right">
                     <a href="[% link %]case_id[% paren %]">ID[% table.arrow IF table.last_sort == 'case_id' %]</a></th>
    <th align="left"><a href="[% link %]alias[% paren %]">Alias[% table.arrow IF table.last_sort == 'alias' %]</a></th>
    <th align="left"><a href="[% link %]summary[% paren %]">Summary[% table.arrow IF table.last_sort == 'summary' %]</a></th>
    <th align="left"><a href="[% link %]requirement[% paren %]">Requirement[% table.arrow IF table.last_sort == 'requirement' %]</a></th>
    <th align="left"><a href="[% link %]author[% paren %]">Author[% table.arrow IF table.last_sort == 'author' %]</a></th>
    <th align="left"><a href="[% link %]tester[% paren %]">Default Tester[% table.arrow IF table.last_sort == 'tester' %]</a></th>
    <th align="left"><a href="[% link %]created[% paren %]">Created[% table.arrow IF table.last_sort == 'author' %]</a></th>
    <th align="left"><a href="[% link %]category[% paren %]">Category[% table.arrow IF table.last_sort == 'category' %]</a></th>
    <th align="left"><a href="[% link %]priority[% paren %]">Priority[% table.arrow IF table.last_sort == 'priority' %]</a></th>
    <th align="left"><a href="[% link %]case_status[% paren %]">Status[% table.arrow IF table.last_sort == 'status' %]</a></th>
  </tr>
[% FOREACH case = table.list %] 
  [% index = loop.count %] 
  <tr id="trr[% index FILTER none %]" class="[% loop.count % 2 == 0 ? "bz_row_odd" : "bz_row_even" %]" [% IF loop.size < MAX_LIMIT %]onclick="sr([% loop.count %]);" style="cursor:pointer;"[% END %]>
    <td class="cc_trg" valign="top" width="24">
      <table style="border-spacing:0px;border-collapse:collapse;" width="24">
        <tr>
          <td style="padding:0;border-width:0;">[% IF dotweak %]<input type="checkbox" style="border: none" id="c_[% case.id FILTER none %]" name="c_[% case.id FILTER none %]" onclick="[% IF canedit %]ck(this);[% ELSE %]_disable_sr=true;[% END %]">[% END %]</td>
          <td style="padding:0;border-width:0;">[% IF loop.size < MAX_LIMIT %]<img id="id[% index FILTER none %]" src="testopia/img/tr.gif" width="11" height="11">[% END %]</td>
        </tr>
      </table>
    </td>

    <td align="right" valign="top"><a onclick="_disable_sr=true;" href="tr_show_case.cgi?case_id=[% case.case_id FILTER none %]">[% case.id FILTER none %]</a></td>
    <td align="left" valign="top">[% case.alias FILTER html %]</td>
    <td align="left" valign="top"><a onclick="_disable_sr=true;" href="tr_show_case.cgi?case_id=[% case.case_id FILTER none %]">[% case.summary FILTER html %]</a></td>
    <td align="left" valign="top">[% case.requirement FILTER html %]</td>
    <td align="left" valign="top"><a href="mailto:[% case.author.login %]">[% case.author.login FILTER html %]</a></td> 
    <td align="left" valign="top"><a href="mailto:[% case.default_tester.login %]">[% case.default_tester.login FILTER html %]</a></td> 
    <td align="left" valign="top">[% case.creation_date FILTER time %]</td>
    <td align="left" valign="top">[% case.category.name FILTER html %]</td>
    <td align="left" valign="top">[% case.priority FILTER html %]</td>
    <td align="left" valign="top"><span id="sta[% case.status %]">[% case.status FILTER html %]</span></td>
  </tr>
  [% IF loop.size < MAX_LIMIT %]
  <tr class="[% loop.count % 2 == 0 ? "bz_row_odd" : "bz_row_even" %]">
    <td></td>
    <td colspan="10" style="margin:0px;padding:0px;">
      <div id="ra[% loop.count %]" class="ae_dv" style=
      "padding-top:5px;padding-bottom:10px;">
        <table class="ae_tb">
          <tr>
            <td colspan="3"><b>Summary:</b> [% case.summary FILTER html %]</td>
          </tr>
          <tr>
            <td valign="top" width="50%" class="ae_s"><div style="overflow:auto" ><b>Action:</b><br>
            [% case.text.action %]</div></td>

            <td style="width:10px">
            </td>

            <td valign="top" width="50%" class="ae_s"><div style="overflow:auto" ><b>Expected Results:</b><br>
            [% case.text.effect %]</div></td>
          </tr>
        </table>

        <div class="cc_xx">
          <div style="float:left;">
            <b>Found in Plans:</b>
            [% FOREACH p = case.plans %]
              <a href="tr_show_plan.cgi?plan_id=[% p.id FILTER none %]">[% p.id FILTER none %]</a>
            [% END %]
          </div>
          <div style="float:right;">
            [% IF case.can_unlink_plan(p.id) %]
              <a href="tr_show_case.cgi?action=unlink&plan_id=[% p.id FILTER none %]&case_id=[% case.id FILTER none %]">Unlink</a>
            [% END %]            
            [% IF plan.candelete %]
              <a href="tr_show_case.cgi?case_id=[% case.id FILTER none %]&action=Delete">Delete</a>
            [% END %]
          </span>    
        </div>
      </div>
    </td>
  </tr>
  [% END %]
[% END %] 
</table>
  [% PROCESS navigation %]
  [% DECORATIVE_BORDER_END %]

[%# No else clause required here -- see list.html.tmpl just below
  # PROCESS testopia/case/table.html.tmpl
  #%]

[% END %]
