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

[%
  rendered_custom_fields.push('cf_crash_signature');
  WRAPPER bug_modal/field.html.tmpl
    label = "Signature"
    field = bug_fields.cf_crash_signature
    field_type = bug_fields.cf_crash_signature.type
    hide_on_view = bug.cf_crash_signature == "" || bug.cf_crash_signature == "---";
%]
  [% IF split_cf_crash_signature.size %]
    [% FOREACH sig IN split_cf_crash_signature %]
      <div>
        [% IF sig.match('^\[\@\s*') && sig.match('\s*\]$') %]
          [% sig = sig.replace('(^\[\@\s*|\s*\]$)', '') %]
          <a href="https://crash-stats.mozilla.org/signature/?signature=[% sig FILTER uri %]" target="_blank" rel="noopener noreferrer">
            [@ [% sig FILTER html %] ]
          </a>
        [% ELSE %]
          [% sig FILTER html %]
        [% END %]
      </div>
    [% END %]
    [%# socorro_lens_url() is defined in Bugzilla/Template.pm %]
    [% SET lens_url = socorro_lens_url(split_cf_crash_signature) %]
    [% IF lens_url %]
      <iframe src="[% lens_url FILTER html %]" style="border:0; width:300px; height:200px; max-width:600px; max-height:300px; float:left;" id="chart" scrolling="no"></iframe>
    [% END %]
  [% ELSIF value %]
    <span class="multiline-value">[% value FILTER html FILTER html_line_break %]</span>
  [% END %]
[% END %]
