[%# 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 BMO Extension
  #
  # The Initial Developer of the Original Code is the Mozilla Foundation
  # Portions created by the Initial Developers are Copyright (C) 2011 the
  # Initial Developer. All Rights Reserved.
  #
  # Contributor(s):
  #   David Lawrence <dkl@mozilla.com>
  #%]

[% INCLUDE global/header.html.tmpl
  title = "Group Admins Report"
  style_urls = [ "extensions/BMO/web/styles/reports.css" ]
%]

[% IF groups.size > 0 %]
  <table id="report" class="standard">
  <thead>
    <tr>
      <th align="left">Name</th>
      <th align="left">Owner</th>
      <th align="left">Admins</th>
    </tr>
  </thead>
  <tbody>
    [% FOREACH group = groups %]
      [% count = loop.count() %]
      <tr class="report_item [% count % 2 == 1 ? "report_row_odd" : "report_row_even" %]">
        <td nowrap>
          <span title="[% group.description FILTER html %]">
            [% group.name FILTER html %]</span>
        </td>
        <td nowrap>
          [% IF group.owner.login == Bugzilla.localconfig.nobody_user %]
            &ndash;
          [% ELSE %]
            [% INCLUDE global/user.html.tmpl who = group.owner %]
          [% END %]
        </td>
        <td>
          [% FOREACH admin = group.admins %]
            [% INCLUDE global/user.html.tmpl who = admin %][% ", " UNLESS loop.last %]
          [% END %]
        </td>
      </tr>
    [% END %]
  </tbody>
  </table>
[% ELSE %]
  <p>
    No groups found.
  </p>
[% END %]

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