[%# 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:
  # comp: object; Bugzilla::Component object representing the component the
  #               user wants to delete.
  # product: object; Bugzilla::Product object representing the product to
  #               which the component belongs.
  #%]

[% title = BLOCK %]Удаление компонента '[% comp.name FILTER html %]'
продукта '[% product.name FILTER html %]'
  [% END %]

[% PROCESS global/header.html.tmpl
  title = title
  style_urls = ['skins/standard/admin.css']
%]

<table id="admin_table">
  <tr class="column_header">
    <th>Поле</th>
    <th>Значение</th>
  </tr>
  <tr>
    <td>Компонент:</td>
    <td>[% comp.name FILTER html %]</td>
  </tr>
  <tr>
    <td>Описание компонента:</td>
    <td>[% comp.description FILTER html_light %]</td>
  </tr>
  <tr>
    <td>Ответственный исполнитель:</td>
    <td>[% comp.default_assignee.login FILTER html %]</td>
  </tr>

  [% IF Param('useqacontact') %]
    <tr>
      <td>Ответственный за приемку:</td>
      <td>[% comp.default_qa_contact.login FILTER html %]</td>
    </tr>
  [% END %]

  <tr>
    <td>Компонент продукта:</td>
    <td>[% product.name FILTER html %]</td>
  </tr>

  [% IF product.description %]
    <tr>
      <td>Описание продукта:</td>
      <td>[% product.description FILTER html_light %]</td>
    </tr>
  [% END %]

  [% IF Param('usetargetmilestone') %]
    <tr>
      <td>Планы продукта:</td>
      <td>
        <a href="[% product.milestone_url FILTER html %]">
          [% product.milestone_url FILTER html %]</a>
      </td>
    </tr>
  [% END %]

  <tr>
    <td>Открыт для регистрации [% terms.bugs_gen %]</td>
    <td>[% IF product.is_active && comp.isactive %]Да[% ELSE %]Нет[% END %]</td>
  </tr>
  <tr>
    <td>[% terms.Bugs_gen %]</td>
    <td>
      [% IF comp.bug_count %]
        <a title="Список [% terms.bugs_gen %] компонента '[% comp.name FILTER html %]'"
           href="buglist.cgi?component=[% comp.name FILTER uri %]&amp;product=
                 [%- product.name FILTER uri %]">[% comp.bug_count %]</a>
      [% ELSE %]
          Не зарегистрировано
      [% END %]
    </td>
  </tr>
</table>

<h2>Подтверждение</h2>

[% IF comp.bug_count %]

  [% IF !Param("allowbugdeletion") %]
    <p class="confirmation">
      Для компонента
      [% numeral(comp.bug_count,
         "зарегистрирована ${comp.bug_count} ${terms.bug}",
         "зарегистрировано ${comp.bug_count} ${terms.bug_gen}",
         "зарегистрировано ${comp.bug_count} ${terms.bugs_gen}")
      FILTER html %].  
      Без переноса

      [% IF comp.bug_count > 1 %]
        их [% terms.bugs %]
      [% ELSE %]
        её [% terms.bug %]
      [% END %]
      в другие компоненты удаление невозможно.
    </p>
  [% ELSE %]
    <p class="confirmation">
      Для компонента 
      [% numeral(comp.bug_count,
         "зарегистрирована ${comp.bug_count} ${terms.bug}",
         "зарегистрировано ${comp.bug_count} ${terms.bugs}",
         "зарегистрировано ${comp.bug_count} ${terms.bugs_gen}")
      FILTER html %]!
      Удаление компонента приведет к удалению <b>ВСЕХ</b> его 
      [% terms.bugs_gen %] и переписки по ним.
    </p>
  [% END %]

[% END %]

[% IF comp.bug_count == 0 || Param('allowbugdeletion') %]

  <p>Удалить компонент?</p>
  
  <form method="post" action="editcomponents.cgi">
  <input type="submit" id="delete" value="Да, удалить">
  <input type="hidden" name="action" value="delete">
  <input type="hidden" name="product" value="[% product.name FILTER html %]">
  <input type="hidden" name="component" value="[% comp.name FILTER html %]">
  <input type="hidden" name="token" value="[% token FILTER html %]">
  </form>

[% END %]

[% PROCESS admin/components/footer.html.tmpl %]

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