[%# 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>
  #%]

[%# INTERFACE:
  # ...
  #%]

[%############################################################################%]
[%# Template Initialization                                                  #%]
[%############################################################################%]

[% PROCESS global/variables.none.tmpl %]

[% title = "Test Runs" %]

[%############################################################################%]
[%# Page Header                                                              #%]
[%############################################################################%]

[% PROCESS global/header.html.tmpl
   style_urls = ['testopia.css'] %]

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

[%# More than this will cause your browser to get really slow 
  # So we won't show the action and effects %]
[% SET MAX_LIMIT = 500 %]
[% IF table.view_count < MAX_LIMIT %]
<script type="text/javascript">
  djConfig = {
    parseWidgets: false,
    searchIds: ["tags", "addtags"]
  };
</script>
[% END %] 
<script src="testopia/js/util.js" type="text/javascript"></script>
<script src="testopia/dojo/dojo.js" type="text/javascript"></script>

<form id="table" action="tr_list_runs.cgi" method="POST">

[% PROCESS testopia/run/table.html.tmpl %]

<p>
[% IF table.list_count == 0 %]
No test runs
[% ELSE %]
  [% IF table.list_count == 1 %]
    One test run
  [% ELSE %]
    [% table.list_count FILTER none %] test runs
  [% END %]
[% END %]
found.
</p>

[% IF dotweak AND table.list_count %]
<h3>Update Selected Test Runs</h3>

<table border="0">

  <tr>
    <td align="right"><b>Manager</b></td>
    <td><input name="manager"/></td>
    <td align="right">
    <select name="tag_action">
      <option value="add">Add</option>
      <option value="rem">Remove</option>
    </select>
       <b>Tags</b></td>
    <td><input id="addtags" name="addtags"
                   dojoType="combobox" 
                   dataUrl="tr_quicksearch.cgi?action=gettag&search=${searchString}" 
                   mode="remote"
                   maxListLength="10"></td>
  </tr>
  <tr>
    </td>
    <td align="right"><b>Status<b></td>
    <td>
    [% PROCESS select sel = { name  => 'run_status',
                              accesskey => 's', 
                              list      => status_list
                              default   => "--Do Not Change--" } %]

    </td>
    <td align="right"><b>Environment<b></td>
    <td><input name="environment" id="environment" value="--Do Not Change--" />
          <a href="tr_query.cgi?current_tab=environment" target="blank"><img src="testopia/img/env_lookup.png" align="middle"></a>
    </td>

[% IF NOT multiprod %]
    <td align="right"><b>Build<b></td>
    <td>
    [% PROCESS select sel = { name  => 'build',
                              accesskey => 'b', 
                              list      => build_list
                              default   => "--Do Not Change--" } %]

    </td>
[% ELSE %]
  <input type="hidden" name="build" value="-1"/>
[% END %]
  </tr>
</table>        

<p>
  <input type="hidden" name="multiprod" value="[% multiprod FILTER none %]"/>
  <input TYPE="SUBMIT" name="action" class="tr_button" VALUE="Commit">
</p>
  

[% END %]
</form>
[% PROCESS "testopia/saved-search.html.tmpl" %]
[%############################################################################%]
[%# Page Footer                                                              #%]
[%############################################################################%]

[% PROCESS global/footer.html.tmpl %]
