queue.html.tmpl 6.24 KB
Newer Older
1
[%# 1.0@bugzilla.org %]
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
[%# 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): Myk Melez <myk@mozilla.org>
  #%]

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

24 25 26
[% USE Bugzilla %]
[% cgi = Bugzilla.cgi %]

27
[% PROCESS "global/js-products.html.tmpl" %]
28

29 30 31 32
[% PROCESS global/header.html.tmpl
  title="Request Queue"
  style = "
    table.requests th { text-align: left; }
33
    table#filtering th { text-align: right; }
34
  "
35 36
  onload="var f = document.forms[0]; selectProduct(f.product, f.component, null, null, 'Any');"
  javascript_urls=["js/productform.js"]
37 38
%]

39 40 41 42 43 44 45
<p>
When you are logged in, only requests made by you or addressed to you
are shown by default.  You can change the criteria using the form below.
When you are logged out, all pending requests that are not restricted
to some group are shown by default.
</p>

46 47 48
<form action="request.cgi" method="get">
  <input type="hidden" name="action" value="queue">

49
  <table id="filtering">
50 51
    <tr>
      <th>Requester:</th>
52 53
      <td><input type="text" name="requester" value="[% cgi.param('requester') FILTER html %]" size="20" 
           title="Requester's email address"></td>
54 55
      <th>Product:</th>
      <td>
56
        <select name="product" onchange="selectProduct(this, this.form.component, null, null, 'Any');">
57
          <option value="">Any</option>
58 59 60 61
          [% FOREACH prod = products %]
            <option value="[% prod.name FILTER html %]"
                    [% "selected" IF cgi.param('product') == prod.name %]>
              [% prod.name FILTER html %]</option>
62 63 64 65 66
          [% END %]
        </select>
      </td>
      <th>Flag:</th>
      <td>
67 68
        [% PROCESS "global/select-menu.html.tmpl"
                    name="type"
69
                    options=types
70
                    default=cgi.param('type') %]
71
      </td>
72

73 74 75 76
      [%# We could let people see a "queue" of non-pending requests. %]
      <!--
      <th>Status:</th>
      <td>
77 78
        [%# PROCESS "global/select-menu.html.tmpl"
                    name="status"
79
                    options=["all", "?", "+-", "+", "-"]
80
                    default=cgi.param('status') %]
81 82
      </td>
      -->
83

84 85 86
    </tr>
    <tr>
      <th>Requestee:</th>
87 88
      <td><input type="text" name="requestee" value="[% cgi.param('requestee') FILTER html %]" size="20" 
           title="Requestee's email address or &quot;-&quot; (hyphen) for requests with no requestee"></td>
89 90 91 92
      <th>Component:</th>
      <td>
        <select name="component">
          <option value="">Any</option>
93 94 95 96 97
          [% FOREACH prod = products %]
            [% FOREACH comp = prod.components %]
              <option value="[% comp.name FILTER html %]" [% "selected" IF cgi.param('component') == comp.name %]>
                [% comp.name FILTER html %]</option>
            [% END %]
98 99 100 101 102
          [% END %]
        </select>
      </td>
      <th>Group By:</th>
      <td>
103 104 105 106 107
        [% groups = {
            "Requester" => 'requester' ,
            "Requestee" => 'requestee',
            "Flag" => 'type' ,
            "Product/Component" => 'category'
108
          } %]
109
        [% PROCESS "global/select-menu.html.tmpl" name="group" options=groups default=cgi.param('group') %]
110
      </td>
111
      <td><input type="submit" id="filter" value="Filter"></td>
112 113 114 115
    </tr>
  </table>

</form>
116

117 118 119 120 121
[% column_headers = {
      "type"       => "Flag" ,
      "status"     => "Status" ,
      "bug"        => "$terms.Bug" ,
      "attachment" => "Attachment" ,
122
      "requester"  => "Requester" ,
123 124
      "requestee"  => "Requestee" ,
      "created"    => "Created" ,
125 126 127 128 129 130 131
      "category"   => "Product/Component"    } %]

[% DEFAULT display_columns = ["requester", "requestee", "type", "bug", "attachment", "created"]
           group_field     = "Requestee"
           group_value     = ""
%]

132 133 134 135
[% IF debug %]
  <p>[% query FILTER html %]</p>
[% END %]

136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158
[% IF requests.size == 0 %]
  <p>
    No requests.
  </p>
[% ELSE %]
  [% FOREACH request = requests %]
    [% IF loop.first %] [% PROCESS start_new_table %] [% END %]
    [% IF request.$group_field != group_value %]
      [% group_value = request.$group_field %]
      [% UNLESS loop.first %]
        </table>
        [% PROCESS start_new_table %]
      [% END %]
    [% END %]
    <tr>
      [% FOREACH column = display_columns %]
        [% NEXT IF column == group_field || excluded_columns.contains(column) %]
        <td>[% PROCESS "display_$column" %]</td>
      [% END %]
    </tr>
  [% END %]
  </table>
[% END %]
159 160 161 162

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

[% BLOCK start_new_table %]
163
  <h3>[% column_headers.$group_field %]: [% (request.$group_field || "None") FILTER html %]</h3>
164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187
  <table class="requests" cellspacing="0" cellpadding="4" border="1">
    <tr>
      [% FOREACH column = display_columns %]
        [% NEXT IF column == group_field || excluded_columns.contains(column) %]
        <th>[% column_headers.$column %]</th>
      [% END %]
    </tr>
[% END %]

[% BLOCK display_type %]
  [% request.type FILTER html %]
[% END %]

[% BLOCK display_status %]
  [% request.status %]
[% END %]

[% BLOCK display_bug %]
  <a href="show_bug.cgi?id=[% request.bug_id %]">
    [% request.bug_id %]: [%+ request.bug_summary FILTER html %]</a>
[% END %]

[% BLOCK display_attachment %]
  [% IF request.attach_id %]
188
    <a href="attachment.cgi?id=[% request.attach_id %]&amp;action=edit">
189 190 191 192 193 194 195 196 197 198 199 200 201 202 203
      [% request.attach_id %]: [%+ request.attach_summary FILTER html %]</a>
  [% ELSE %]
    N/A
  [% END %]
[% END %]

[% BLOCK display_requestee %]
  [% request.requestee FILTER html %]
[% END %]

[% BLOCK display_requester %]
  [% request.requester FILTER html %]
[% END %]

[% BLOCK display_created %]
204
  [% request.created FILTER time %]
205 206
[% END %]