[%# 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 Bugzilla Bug Tracking System.
  #
  # The Initial Developer of the Original Code is Netscape Communications
  # Corporation. Portions created by Netscape are
  # Copyright (C) 1998 Netscape Communications Corporation. All
  # Rights Reserved.
  #
  # Contributor(s): Myk Melez <myk@mozilla.org>
  #%]

[%# INTERFACE:
  # operations: array; bug activity since the user last displayed the bug form,
  #   used by bug/activity/table.html.tmpl to display recent changes that will
  #   be overwritten if the user submits these changes.  See that template
  #   for further documentation.
  # comments: array; the comments on the bug added after user has last viewed the page.
  # bug: Bugzilla::Bug; the bug being changed.
  #%]

[% PROCESS "bug/show-header.html.tmpl" title="Mid-air collision!" %]

<h1>Mid-air collision detected!</h1>

<p>
  Someone else has made changes to
  [%+ "$terms.bug $bug.id" FILTER bug_link(bug) FILTER none %]
  at the same time you were trying to.
  The changes made were:
</p>

<p>
  [% PROCESS "bug/activity/table.html.tmpl" incomplete_data=0 %]
</p>

[% IF comments.size %]
<p>
  Added the comment(s):
  <blockquote>
    [% PROCESS "bug/comments.html.tmpl" collision = 1 %]
  </blockquote>
</p>
[% END %]

[% IF ARGS.comment %]
<p>
  Your comment was:<br>
  <blockquote><div class="bz_comment_text">
    [% ARGS.comment FILTER quoteUrls(bug) FILTER wrap_comment %]
  </div></blockquote>
</p>
[% END %]

<p>
You have the following choices:
</p>

<ul>
  <li>
    <form method="post" action="process_bug.cgi">
      <input type="hidden" name="delta_ts" value="[% bug.delta_ts FILTER html %]">
      <input type="hidden" name="token" value="[% ARGS.token | html %]">
      [% PROCESS "global/hidden-fields.html.tmpl"
          exclude="^Bugzilla_login|Bugzilla_password|delta_ts|token$" %]
      <input type="submit" id="process" value="Submit my changes anyway">
        This will cause conflicting changes to be overwritten with yours
        [% ", except for the added comment(s)" IF comments.size %].
    </form>
  </li>
  [% IF ARGS.comment %]
    <li>
      <form method="post" action="process_bug.cgi">
        <input type="hidden" name="id"             value="[% ARGS.id | html %]">
        <input type="hidden" name="delta_ts"       value="[% bug.delta_ts | html %]">
        <input type="hidden" name="comment"        value="[% ARGS.comment | html %]">
        <input type="hidden" name="commentsilent"  value="[% ARGS.commentsilent | html %]">
        <input type="hidden" name="work_time"      value="[% ARGS.work_time | html %]">
        <input type="hidden" name="commentprivacy" value="[% ARGS.commentprivacy | html %]">
        <input type="hidden" name="token"          value="[% ARGS.token | html %]">
        [%# Double mid-air collision needs longdesclength in params! %]
        <input type="hidden" name="longdesclength" value="[% comments.size | html %]">
        <input type="submit" id="process_comment" value="Submit only my new comment">
      </form>
    </li>
  [% END %]
  <li>
    Throw away my changes, and
    [%+ "revisit $terms.bug $bug.id" FILTER bug_link(bug) FILTER none %]
  </li>
</ul>

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