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

[% RETURN UNLESS user.id && Bugzilla.params.bitly_token %]

<div id="bitly-overlay">
  <div>
    <select id="bitly-type">
      <option value="shorten">Share a link to this search</option>
      <option value="list">Share a link to this list of [% terms.bugs %]</option>
    </select>
    <input id="bitly-url" readonly placeholder="Generating short link...">
  </div>
  <button id="bitly-close" class="notransition">Close</button>
</div>
<a id="bitly-shorten" href="#"
   data-url="[% urlbase _ "buglist.cgi?" _
                cgi.new(urlquerypart).canonicalize_query('list_id','query_format') FILTER html %]"
>Short URL</a>
|&nbsp; [%# using nbsp because tt always trims trailing whitespace from templates %]
