[%# 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.
  #%]

[% PROCESS global/header.html.tmpl
  title = "Release Tracking Flags"
  style_urls = [ 'extensions/TrackingFlags/web/styles/admin.css' ]
  javascript_urls = [ 'extensions/TrackingFlags/web/js/admin.js' ]
%]

<table id="flag_list" class="standard">

<tr>
  <th>Name</th>
  <th>Description</th>
  <th>Type</th>
  <th>Sort Key</th>
  <th>Active</th>
  [% IF show_bug_counts %]
    <th>[% terms.Bugs %]</th>
  [% END %]
  <th>&nbsp;</th>
</tr>

[% FOREACH flag = flags %]
  <tr class="flag_row
             [% loop.count % 2 == 1 ? " odd_row" : " even_row" %]
             [% " is_disabled" UNLESS flag.is_active %]">
    <td [% 'class="disabled"' UNLESS flag.is_active %]>
      <a href="[% basepath FILTER none %]page.cgi?id=tracking_flags_admin_edit.html&amp;mode=edit&amp;flag_id=[% flag.flag_id FILTER uri %]">
        [% flag.name FILTER html %]
      </a>
    </td>
    <td [% 'class="disabled"' UNLESS flag.is_active %]>
      [% flag.description FILTER html %]
    </td>
    <td [% 'class="disabled"' UNLESS flag.is_active %]>
      [% flag.flag_type FILTER html %]
    </td>
    <td [% 'class="disabled"' UNLESS flag.is_active %]>
      [% flag.sortkey FILTER html %]
    </td>
    <td>
      [% flag.is_active ? "Yes" : "No" %]
    </td>
    [% IF show_bug_counts %]
      <td>
        [% flag.bug_count FILTER html %]
      </td>
    [% END %]
    <td>
      <a href="[% basepath FILTER none %]page.cgi?id=tracking_flags_admin_edit.html&amp;mode=copy&amp;copy_from=[% flag.flag_id FILTER uri %]">Copy</a>
    </td>
  </tr>
[% END %]

</table>

<div id="new_flag">
  <a href="[% basepath FILTER none %]page.cgi?id=tracking_flags_admin_edit.html">Add Flag</a> |
  [% IF !show_bug_counts %]
    <a href="[% basepath FILTER none %]page.cgi?id=tracking_flags_admin_list.html&amp;show_bug_counts=1">
      Show [% terms.bug %] counts (slower)</a> |
  [% END %]
  <input type="checkbox" onclick="filter_flag_list(this.checked)" id="filter">
  <label for="filter">Show disabled flags</label>
</div>

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