[%# 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 # Frédéric Buclin # Guy Pyrzak #%] [% PROCESS global/variables.none.tmpl %] [%# Define strings that will serve as the title and header of this page %] [% title = BLOCK %] Attachment [% attachment.id %] Details for [% terms.Bug %] [%+ attachment.bug_id %] [% END %] [% header = BLOCK %] Attachment [% attachment.id %] Details for [%+ "$terms.Bug ${attachment.bug_id}" FILTER bug_link(attachment.bug_id) FILTER none %] [% END %] [% subheader = BLOCK %][% attachment.bug.short_desc FILTER html %][% END %] [% PROCESS global/header.html.tmpl title = title header = header subheader = subheader doc_section = "attachments.html" javascript_urls = ['js/attachment.js'] style_urls = ['skins/standard/attachment.css'] bodyclasses = "no_javascript" %] [%# No need to display the Diff button and iframe if the attachment is not a patch. %] [% use_patchviewer = (feature_enabled('patch_viewer') && attachment.ispatch) %] [% can_edit = attachment.validate_can_edit %] [% editable_or_hide = can_edit ? "" : " bz_hidden_option" %]
[% IF user.id %] [% END %]
[% "[patch]" IF attachment.ispatch%] [% attachment.description FILTER html %] [% IF can_edit %] (edit details) [% END %]
[% attachment.filename FILTER html %] ([% attachment.contenttype FILTER html %]) [% IF attachment.datasize %] [%+ attachment.datasize FILTER unitconvert %] [% ELSE %] deleted [% END %], created by [%+ INCLUDE global/user.html.tmpl who = attachment.attacher %] [% IF attachment.isprivate %] Only visible to [% Param('insidergroup') FILTER html %] [% END %]
(hide)
  [% INCLUDE global/textarea.html.tmpl id = 'description' name = 'description' minrows = 3 cols = 25 wrap = 'soft' classes = 'block' _ editable_or_hide defaultcontent = attachment.description %]
Creator: [%+ INCLUDE global/user.html.tmpl who = attachment.attacher %]
Size: [% IF attachment.datasize %] [%+ attachment.datasize FILTER unitconvert %] [% ELSE %] deleted [% END %]
[% IF user.is_insider %]
[% IF can_edit %] [% ELSE %] Is Private: [%+ attachment.isprivate ? "yes" : "no" %] [% END %]
[% END %]
[% IF !attachment.datasize %]
The content of this attachment has been deleted.
[% ELSIF !Param("allow_attachment_display") %]

The attachment is not viewable in your browser due to security restrictions enabled by your [% terms.Bugzilla %] administrator.

In order to view the attachment, you first have to download it.

[% ELSIF attachment.is_viewable %]
[% INCLUDE global/textarea.html.tmpl id = 'editFrame' name = 'comment' classes = 'bz_default_hidden' minrows = 10 cols = 80 wrap = 'soft' disabled = 'disabled' defaultcontent = (attachment.contenttype.match('^text\/')) ? attachment.data.replace('(.*\n|.+)', '>$1') : undef %] [%# The regexp is stolen from quoteUrls(), see Template.pm %] [% safe_protocols = constants.SAFE_PROTOCOLS.join('|') %] [% IF attachment.contenttype == 'text/plain' && attachment.data.match("^($safe_protocols):" _ '[^\s<>\"]+[\w\/]$') %]

[% IF attachment.datasize < 120 %] [% attachment.data FILTER html %] [% ELSE %] [% attachment.data FILTER truncate(80) FILTER html %] ... [% attachment.data.match('.*(.{20})$').0 FILTER html %] [% END %]

[% ELSE %] [% END %]
[% ELSE %]

Attachment is not viewable in your browser because its MIME type ([% attachment.contenttype FILTER html %]) is not one that your browser is able to display.

Download the attachment.

[% END %]
[% IF user.id %]
[% classNames = 'block' %] [% classNames = "$classes bz_private" IF attachment.isprivate %] [% INCLUDE global/textarea.html.tmpl id = 'comment' name = 'comment' minrows = 10 cols = 80 wrap = 'soft' classes = classNames %]
[% END %]
[% IF attachment.flag_types.size > 0 %] [% PROCESS "flag/list.html.tmpl" bug_id = attachment.bug_id attach_id = attachment.id flag_types = attachment.flag_types read_only_flags = !can_edit %] [% END %]
[% IF user.id %]
[% END %]
Actions: View [% IF use_patchviewer %] | Diff [% END %] [% IF Param("allow_attachment_deletion") && user.in_group('admin') && attachment.datasize > 0 %] | Delete [% END %]
Attachments on [% "$terms.bug ${attachment.bug_id}" FILTER bug_link(attachment.bug_id) FILTER none %]: [% FOREACH a = attachments %] [% IF a == attachment.id %] [%+ a %] [% ELSE %] [% a %] [% END %] [% " |" UNLESS loop.last() %] [% END %]
[% IF can_edit %] [% END %] [% Hook.process('end') %] [% PROCESS global/footer.html.tmpl %]