[%# 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>
  #%]
  
[% PROCESS testopia/blocks.html.tmpl %]

    <td valign="top" width="24">
      <table style="border-spacing:0px;border-collapse:collapse;" width="24">
        <tr>
      [% IF !caserun.canedit %]
          <td valign="middle" style="cursor:pointer;" onclick="sr([% index %]);">
            <img src="testopia/img/lk.gif" width="13" height="15" alt="locked" title="Locked: This run is stopped" border="0"/>
          </td>
      [% END %]

          <td valign="bottom" style="padding:2;border-width:0; cursor:pointer;" onclick="sr([% index %]);">
            <img id="id[% index %]" src="testopia/img/[% updating ? 'td.gif' : 'tr.gif' %]" width="11" height="11" alt="click to expand" border="0"/>
          </td>
        </tr>
      </table>
    </td>
    <td align="left"><a href="tr_show_case.cgi?case_id=[% caserun.case.id FILTER none %]" title="[% caserun.case.summary FILTER html %]">[% caserun.case.id FILTER html %]</a></td>
    <td align="right"><input name="sortkey_[% index %]" id="sortkey_[% index %]" value="[% caserun.sortkey FILTER html %]" size="5">
                  [% IF caserun.canedit %]
                      <input type="button" value="Change" onclick="chSortKey([% index %], [% caserun.id FILTER none %], document.getElementById('sortkey_[% index %]').value);"></td>
                  [% END %]
    <td align="right" valign="top">
    [% IF caserun.canedit %]
    [% PROCESS select sel = { name => "caserun_build", 
                              list => caserun.run.plan.product.builds(1), 
                           default => caserun.build.name 
                           events  => "onChange='chBld($index, this.value, \"$caserun.status\", $caserun.id)'"}
     %]
     [% ELSE %]
       [% caserun.build.name FILTER html %]
     [% END %]
    </td>
    <td align="left" valign="top">
      <a href="tr_show_environment.cgi?env_id=[% caserun.environment.id FILTER none %]">[% caserun.environment.name FILTER html %]</a>
    [% IF caserun.canedit %]
          <input dojoType="combobox" 
                 dataUrl="tr_quicksearch.cgi?action=getenv&run_id=[% caserun.run.id FILTER none %]&search=${searchString}" 
                 mode="remote"
                 autoComplete="false"
                 id="env_[% index %]"
                 maxListLength="10"
                 onValueChanged='chEnv([% index %], this.comboBoxSelectionValue.value, "[% caserun.status %]", [% caserun.id %], [% caserun.environment_id %])'>
    [% END %]
    </td>

    <td align="left" valign="top"><span id="own[% index %]"><a href="mailto:[% caserun.assignee.login %]">[% caserun.assignee.login %]</a></span></td>
    <td align="left" valign="top"><span id="tdb[% index %]"><a href="mailto:[% caserun.testedby.login %]">[% caserun.testedby.login %]</a></span></td>
    <td align="left" valign="top">
      <span id="cld[% index %]">[% caserun.close_date FILTER time %]      </span>
    </td>

    <td align="center" valign="top" onclick="sr([% index %]);">
      <span style="width:14px;display:table-cell; align: center; cursor:pointer;">
        <img id="xs[% caserun.id FILTER none %]" 
        src="testopia/img/[% caserun.status FILTER none %]_small.gif" title="[% caserun.status FILTER none %]" alt="[% caserun.status FILTER none %]"
        width="14" height="14"/>
      </span>
    </td>
    <td align="left" valign="top">[% caserun.case.priority FILTER html %]</td>
    <td align="left" valign="top">[% caserun.case.category.name FILTER html %]</td>
    <td align="left" valign="top">[% caserun.case.components.0.name FILTER html %][% '...' IF caserun.case.components.size > 1 %]</td>
    <td align="center" valign="top"><span id="nbgs[% index %]">
    [% FOREACH bug = caserun.bugs %]
      [% bug.bug_id FILTER bug_link(bug.bug_id) %]
    [% END %]</span></td>
