[%# License: MPL 2.0, incompatible with secondary licenses
  # Contributor(s): Gavin Shelley <bugzilla@chimpychompy.org>, Vitaliy Filippov <vitalif@mail.ru>
  #%]

[%# INTERFACE:
  # product: object; Bugzilla::Product object representing the product to which the milestone belongs.
  # milestone: object; Bugzilla::Milestone object representing the milestone the user wants to edit.
  #%]

[% IF milestone.id %]
  [% title = BLOCK %]Edit Milestone '[% milestone.name | html %]' of product '[%- product.name | html %]'[% END %]
[% ELSE %]
  [% title = BLOCK %]Add Milestone to Product '[% product.name | html %]'[% END %]
  [% subheader = BLOCK %]This page allows you to add a new milestone to product '[% product.name | html %]'.[% END %]
[% END %]

[% PROCESS global/header.html.tmpl
  title = title
  subheader = subheader
  onload = "document.forms['f'].milestone.select()"
%]

<form name="f" method="post" action="editmilestones.cgi">

  <table border="0" cellpadding="4" cellspacing="0">
    <tr>
      <th class="field_label"><label for="milestone">Milestone:</label></th>
      <td><input id="milestone" size="20" maxlength="20" name="milestone" value="[%- milestone.name | html %]"></td>
    </tr>
    <tr>
      <th class="field_label"><label for="sortkey">Sortkey:</label></th>
      <td><input id="sortkey" size="20" maxlength="20" name="sortkey" value="[%- milestone.sortkey | html %]"></td>
    </tr>
    [% IF milestone.id %]
    <tr>
      <th class="field_label"><label for="isactive">Enabled For [% terms.Bugs %]:</label></th>
      <td><input id="isactive" name="isactive" type="checkbox" value="1" [% 'checked="checked"' IF milestone.isactive %]></td>
    </tr>
    [% INCLUDE "admin/fieldvalues/control-list-common.html.tmpl" this_field=milestone.field this_value=milestone %]
    [% END %]
  </table>

  <input type="submit" value="[% milestone.id ? "Save Changes" : "Add" %]">
  <input type="hidden" name="action" value="[% milestone.id ? "update" : "new" %]">
  <input type="hidden" name="product" value="[% product.name | html %]">
  <input type="hidden" name="token" value="[% token | html %]">
  [% IF milestone.id %]
  <input type="hidden" name="milestoneold" value="[% milestone.name | html %]">
  [% END %]
</form>

[% PROCESS admin/milestones/footer.html.tmpl
  no_edit_milestone_link = milestone.id
  no_add_milestone_link = !milestone.id
%]

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