[%# 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.
  #
  # Contributor(s): Marc Schumann <wurblzap@gmail.com>
  #%]

[%# INTERFACE:
  #
  # listselectionvalues: selection values to recreate the current user list.
  # editusers:           is viewing user member of editusers?
  # users:               list of user information (id, login_name, realname,
  #                      disabledtext).
  #%]

[% PROCESS global/header.html.tmpl
  title = "Select user"
  style_urls = ['skins/standard/editusers.css']
%]

[% PROCESS admin/users/listselectvars.html.tmpl
  listselectionvalues = listselectionvalues
%]

[% listselectionurlparams = INCLUDE listselectionurlparams %]

[% columns =
  [{name               => 'login_name'
    heading            => 'Edit user...'
    contentlink        => 'editusers.cgi?action=edit&amp;userid=%%userid%%' _
                          listselectionurlparams
   }
   {name               => 'realname'
    heading            => 'Real name'
   }
  ]
%]

[% IF Param('allowuserdeletion') && editusers %]
  [% columns.push({heading     => 'Action'
                   content     => 'Delete'
                   contentlink => 'editusers.cgi?action=del' _
                                  '&amp;userid=%%userid%%' _
                                  listselectionurlparams
                  }
                 )
  %]
[% END %]

[% FOREACH thisuser = users %]
  [% IF thisuser.disabledtext %]
    [% SET thisuser.class = "bz_inactive" %]
  [% END %]
  [% UNLESS thisuser.realname %]
    [% SET thisuser.realname = "missing" %]
    [% SET thisuser.class = thisuser.disabledtext ? "bz_inactive missing" : "missing" %]
  [% END %]
[% END %]

<p>[% users.size %] user[% "s" UNLESS users.size == 1 %] found.</p>

[% PROCESS admin/table.html.tmpl
  columns = columns
  data    = users
%]

<p>
  If you do not wish to modify a user account at this time, you can
  <a href="editusers.cgi">find other users</a>
  [% IF editusers %]
    or
    <a href="editusers.cgi?action=add[% INCLUDE listselectionurlparams %]">add
    a new user</a>
  [% END %].
</p>

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