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

[% USE Bugzilla %]
[% cgi = Bugzilla.cgi %]

[% IF orange_factor %]
  <tr>
    <th class="field_label" valign="top">
      Orange Factor:
    </th>
    <td>
      [% IF cgi.user_agent.match('(?i)gecko') %]
        <canvas id="orange-graph" class="bz_default_hidden"></canvas>
        <span id="orange-count"
              style="display:none;"
              data-date-start="[% date_start FILTER html %]"
              data-date-end="[% date_end FILTER html %]"
              data-bug-id="[% bug.bug_id FILTER html %]">
        </span>
      [% END %]
      (<a href="https://treeherder.mozilla.org/intermittent-failures.html#/bugdetails?startday=[% date_start FILTER uri %]&endday=[% date_end FILTER uri %]&tree=trunk&bug=[% bug.bug_id FILTER uri %]"
          title="Click to load Orange Factor page for this [% terms.bug %]">link</a>)
    </td>
  </tr>
[% END %]
