[%# This Source Code Form is subject to the terms of the Mozilla Public
  # License, v. 2.0. If a copy of the MPL was not distributed with this
  # file, You can obtain one at http://mozilla.org/MPL/2.0/.
  #
  # This Source Code Form is "Incompatible With Secondary Licenses", as
  # defined by the Mozilla Public License, v. 2.0.
  #%]

[%# INTERFACE:
  # name: string. The name of the select block to output.
  # default.$name.0: string. The default value for the block, if any.
  #%]

[% BLOCK select %]
  [% Hook.process('rep_fields', 'search/search-report-select.html.tmpl') %]

  <select name="[% name FILTER html %]">
    <option value="">&lt;none&gt;</option>
    
    [% FOREACH field = report_columns.keys.sort %]
      [% NEXT IF field == "classification" AND !Param('useclassification') %]
      [% NEXT IF field == "target_milestone" AND !Param('usetargetmilestone') %]
      [% NEXT IF field == "qa_contact" AND !Param('useqacontact') %]
      <option value="[% field FILTER html %]" 
        [% " selected" IF default.$name.0 == field %]>
        [% field_descs.$field || field FILTER html %]</option>
    [% END %]
  </select>
[% END %]
