[%# 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 Bug Tracking System.
  #
  # The Initial Developer of the Original Code is Netscape Communications
  # Corporation. Portions created by Netscape are
  # Copyright (C) 1998 Netscape Communications Corporation. All
  # Rights Reserved.
  #
  # Contributor(s): Gervase Markham <gerv@gerv.net>
  #                 Greg Hendricks <ghendricks@novell.com>
  #%]
  
<a href="tr_show_product.cgi?product_id=[% plan.product_id FILTER none %]">Product: [% plan.product.name FILTER html %]</a>
&nbsp;&gt;&nbsp; Plan [% plan.id FILTER html %]
<br/>
[% list = table.get_saved_list('plan') %]
<b>Plan List:</b>
[% IF list > 0 %]
[% curr = lsearch(list, plan.id) %]
[% IF curr != -1 && (curr > 0) %]
  <a href="tr_show_plan.cgi?plan_id=[% list.first %]">&lt;&lt;&nbsp;First</a>
[% ELSE %]
  <i><font color="#777777">&lt;&lt;First</font></i>  
[% END %]

  [% IF plan %]
    [% IF curr != -1 %]
      [% IF curr > 0 %]
        [% prev = curr - 1 %]
        <a href="tr_show_plan.cgi?plan_id=[% list.$prev %]">&lt;&nbsp;Prev</a>
      [% ELSE %]
        <i><font color="#777777">Prev</font></i>
      [% END %]

      [% IF curr != -1 %]
        &nbsp;&nbsp;([% curr + 1 %] of [% list.size %])&nbsp;&nbsp;
      [% END %]

      [% IF curr + 1 < list.size %]
        [% next = curr + 1 %]
        <a href="tr_show_plan.cgi?plan_id=[% list.$next %]">Next&nbsp;&gt;</a>
      [% ELSE %]
        <i><font color="#777777">Next</font></i>
      [% END %]
    [% END %]
  [% ELSE %]
    &nbsp;&nbsp;
  [% END %]

[% IF curr != -1 && (curr + 1 < list.size) %]
  <a href="tr_show_plan.cgi?plan_id=[% list.last %]">Last&nbsp;&gt;&gt;</a>
[% ELSE %]
    <i><font color="#777777">Last&gt;&gt;</font></i>
[% END %]

[% ELSE %]
  [%# With no list, don't show link to search results %]
  &nbsp;&nbsp;
  <i><font color="#777777">No search results available</font></i>
[% END %]
