{# Copyright (C) 2006-2023 Edgewall Software

  This software is licensed as described in the file COPYING, which
  you should have received as part of this distribution. The terms
  are also available at https://trac.edgewall.org/wiki/TracLicense.

  This software consists of voluntary contributions made by many
  individuals. For the exact contribution history, see the revision
  history and logs, available at https://trac.edgewall.org/.
#}
# extends 'layout.html'
<!DOCTYPE html>
<html>
  <head>
    <title>
      # block title
      ${_("Delete Milestone %(name)s", name=milestone.name)}
      ${ super() }
      # endblock title
    </title>
  </head>

  <body>
    # block content
    <div id="content" class="milestone">
      <h1>${_("Delete Milestone %(name)s", name=milestone.name)}</h1>

      <form id="delete-confirm" action="${req.request_path}" method="post">
        <div>
          ${jmacros.form_token_input()}
          <input type="hidden" name="action" value="delete" />
          <p>
            <strong>
              ${_("Are you sure you want to delete this milestone?")}
            </strong>
          </p>
          # if num_tickets != 0:
          <label for="target">${
            _("Retarget associated tickets to milestone")}</label>
          <select name="target" id="target">
            <option value="">${_("None")}</option>
            # for label, milestones in milestone_groups if milestones:
            <optgroup label="${label}">
              # for milestone in milestones:
              <option${{'selected': retarget_to == milestone.name,
                        'value': milestone.name
                       }|htmlattr}>${milestone.name}</option>
              # endfor
            </optgroup>
            # endfor
          </select>
          # endif
          # if num_tickets == 0:
          <p class="help">
            ${_("There are no tickets associated with this milestone.")}
          </p>
          # endif
          # if attachments:
          <p>${_("The following attachments will also be deleted:")}</p>
          <ul>
            # for attachment in attachments:
            <li>
              <a href="${url_of(attachment.resource)}"
                 title="${_('View attachment')}">${attachment.filename}</a>
            </li>
            # endfor
          </ul>
          # endif
          <p><strong>${_("This is an irreversible operation.")}</strong></p>
        </div>
        <div class="buttons">
          <input type="submit" id="delete" class="trac-disable-on-submit"
                 value="${_('Delete milestone')}" />
          <input type="submit" name="cancel" value="${_('Cancel')}" />
        </div>
      </form>

      # call(note, page) jmacros.wikihelp('TracRoadmap'):
      #   trans note, page

      ${note} See ${page} for help on using the roadmap.

      #   endtrans
      # endcall

    </div>
    ${ super() }
    # endblock content
  </body>
</html>
