From 246f6778660fe4a878b1f08eee175b1076c5e224 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Tue, 18 Apr 2006 03:19:35 +0000 Subject: Bug 44595: Implement an interface for administrators to delete attachments - Patch by Frédéric Buclin r=wicked, justdave a=justdave MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../en/default/attachment/confirm-delete.html.tmpl | 91 ++++++++++++++++++++++ .../en/default/attachment/delete_reason.txt.tmpl | 33 ++++++++ template/en/default/attachment/edit.html.tmpl | 16 +++- template/en/default/attachment/list.html.tmpl | 8 +- 4 files changed, 145 insertions(+), 3 deletions(-) create mode 100644 template/en/default/attachment/confirm-delete.html.tmpl create mode 100644 template/en/default/attachment/delete_reason.txt.tmpl (limited to 'template/en/default/attachment') diff --git a/template/en/default/attachment/confirm-delete.html.tmpl b/template/en/default/attachment/confirm-delete.html.tmpl new file mode 100644 index 000000000..99007e579 --- /dev/null +++ b/template/en/default/attachment/confirm-delete.html.tmpl @@ -0,0 +1,91 @@ +[%# 1.0@bugzilla.org %] +[%# 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. + # + # Contributor(s): Frédéric Buclin + #%] + +[%# INTERFACE: + # a: attachment object; attachment the user wants to delete. + # token: string; The token used to identify the session. + #%] + +[% PROCESS global/variables.none.tmpl %] + +[% title = BLOCK %] + Delete Attachment [% a.id FILTER html %] of + [%+ "$terms.Bug " _ a.bug_id FILTER bug_link(a.bug_id) FILTER none %] +[% END %] + +[% PROCESS global/header.html.tmpl title = title %] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldValue
Attachment ID: + [% a.id FILTER html %] +
File name:[% a.filename FILTER html %]
Description:[% a.description FILTER html %]
Contained in [% terms.Bug %]:[% a.bug_id FILTER bug_link(a.bug_id) FILTER none %]
Creator:[% a.attacher.identity FILTER html %]
Creation Date:[% a.attached FILTER time %]
+ +

Confirmation

+ + + + + +
+ The content of this attachment will be deleted in a irreversible way. +
+ +

Do you really want to delete this attachment?

+ +
+ + +

+ + + + +

+ +

+ No, cancel this deletion and return to + [%+ "$terms.bug " _ a.bug_id FILTER bug_link(a.bug_id) FILTER none %]. +

+ +[% PROCESS global/footer.html.tmpl %] diff --git a/template/en/default/attachment/delete_reason.txt.tmpl b/template/en/default/attachment/delete_reason.txt.tmpl new file mode 100644 index 000000000..45879f6ca --- /dev/null +++ b/template/en/default/attachment/delete_reason.txt.tmpl @@ -0,0 +1,33 @@ +[%# 1.0@bugzilla.org %] +[%# 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. + # + # Contributor(s): Frédéric Buclin + #%] + +[%# INTERFACE: + # attachid: ID of the attachment the user wants to delete. + # reason: string; The reason provided by the user. + # date: the date when the request to delete the attachment was made. + #%] + +The content of attachment [% attachid %] has been deleted by + [%+ user.identity %] +[% IF reason %] +who provided the following reason: + +[%+ reason %] +[% ELSE %] +without providing any reason. +[% END %] + +The token used to delete this attachment was generated at [% date FILTER time %]. diff --git a/template/en/default/attachment/edit.html.tmpl b/template/en/default/attachment/edit.html.tmpl index b2b5b13e5..2f02aae34 100644 --- a/template/en/default/attachment/edit.html.tmpl +++ b/template/en/default/attachment/edit.html.tmpl @@ -229,7 +229,12 @@ Filename:

- Size: [% attachment.datasize FILTER unitconvert %]
+ Size: + [% IF attachment.datasize %] + [%+ attachment.datasize FILTER unitconvert %] + [% ELSE %] + deleted + [% END %]
MIME Type:
Diff [% END %] + [% IF Param("allow_attachment_deletion") + && user.groups.admin + && attachment.datasize > 0 %] + | Delete + [% END %] - [% IF isviewable %] + [% IF !attachment.datasize %] + The content of this attachment has been deleted. + [% ELSIF isviewable %] [% INCLUDE global/textarea.html.tmpl id = 'editFrame' diff --git a/template/en/default/attachment/list.html.tmpl b/template/en/default/attachment/list.html.tmpl index 03368ce26..0b42c0c3c 100644 --- a/template/en/default/attachment/list.html.tmpl +++ b/template/en/default/attachment/list.html.tmpl @@ -56,7 +56,13 @@ [% attachment.attached FILTER time %] - [% attachment.datasize FILTER unitconvert %] + + [% IF attachment.datasize %] + [% attachment.datasize FILTER unitconvert %] + [% ELSE %] + deleted + [% END %] + [% IF show_attachment_flags %] -- cgit v1.2.3-24-g4f1b