aboutsummaryrefslogtreecommitdiff
path: root/template/en/default/attachment
diff options
context:
space:
mode:
Diffstat (limited to 'template/en/default/attachment')
-rw-r--r--template/en/default/attachment/choose.html.tmpl29
-rw-r--r--template/en/default/attachment/confirm-delete.html.tmpl83
-rw-r--r--template/en/default/attachment/create.html.tmpl133
-rw-r--r--template/en/default/attachment/created.html.tmpl54
-rw-r--r--template/en/default/attachment/createformcontents.html.tmpl98
-rw-r--r--template/en/default/attachment/delete_reason.txt.tmpl18
-rw-r--r--template/en/default/attachment/diff-file.html.tmpl164
-rw-r--r--template/en/default/attachment/diff-footer.html.tmpl21
-rw-r--r--template/en/default/attachment/diff-header.html.tmpl139
-rw-r--r--template/en/default/attachment/edit.html.tmpl331
-rw-r--r--template/en/default/attachment/list.html.tmpl165
-rw-r--r--template/en/default/attachment/midair.html.tmpl64
-rw-r--r--template/en/default/attachment/show-multiple.html.tmpl106
-rw-r--r--template/en/default/attachment/updated.html.tmpl32
14 files changed, 1437 insertions, 0 deletions
diff --git a/template/en/default/attachment/choose.html.tmpl b/template/en/default/attachment/choose.html.tmpl
new file mode 100644
index 0000000..c6b94d7
--- /dev/null
+++ b/template/en/default/attachment/choose.html.tmpl
@@ -0,0 +1,29 @@
+[%# 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.
+ #%]
+
+[% PROCESS global/header.html.tmpl
+ title = "Locate attachment",
+ onload = "document.forms['choose-id'].id.focus()"
+ %]
+
+<form name="choose-id" method="get" action="attachment.cgi">
+ <p>Access an attachment by entering its ID into the form below:</p>
+ <p>Attachment ID: <input name="id" size="6">
+ <button name="action" value="edit" id="edit">Details</button>
+ <button name="action" value="view" id="view">View</button>
+ </p>
+</form>
+
+<form method="get" action="show_bug.cgi">
+ <p>Or, access it from the list of attachments in its associated [% terms.bug %] report:</p>
+ <p>[% terms.Bug %] ID: <input name="id" size="6">
+ <input type="submit" name="action" value="View" id="action">
+ </p>
+</form>
+
+[% PROCESS global/footer.html.tmpl %]
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 0000000..4557af6
--- /dev/null
+++ b/template/en/default/attachment/confirm-delete.html.tmpl
@@ -0,0 +1,83 @@
+[%# 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.
+ #%]
+
+[%# INTERFACE:
+ # a: attachment object; attachment the user wants to delete.
+ # token: string; The token used to identify the session.
+ #%]
+
+[% title = BLOCK %]
+ Delete Attachment [% a.id FILTER html %] of [% terms.Bug %] [%+ a.bug_id FILTER html %]
+[% END %]
+
+[% PROCESS global/header.html.tmpl
+ title = title
+ doc_section = "attachments.html"
+%]
+
+<table border="1" cellpadding="4" cellspacing="0">
+ <tr bgcolor="#6666FF">
+ <th valign="top" align="left">Field</th>
+ <th valign="top" align="left">Value</th>
+ </tr>
+ <tr>
+ <td valign="top">Attachment ID:</td>
+ <td valign="top">
+ <a href="attachment.cgi?id=[% a.id FILTER html %]">[% a.id FILTER html %]</a>
+ </td>
+ </tr>
+ <tr>
+ <td valign="top">File name:</td>
+ <td valign="top">[% a.filename FILTER html %]</td>
+ </tr>
+ <tr>
+ <td valign="top">Description:</td>
+ <td valign="top">[% a.description FILTER html %]</td>
+ </tr>
+ <tr>
+ <td valign="top">Contained in [% terms.Bug %]:</td>
+ <td valign="top">[% a.bug_id FILTER bug_link(a.bug_id) FILTER none %]</td>
+ </tr>
+ <tr>
+ <td valign="top">Creator:</td>
+ <td valign="top">[% a.attacher.identity FILTER html %]</td>
+ </tr>
+ <tr>
+ <td valign="top">Creation Date:</td>
+ <td valign="top">[% a.attached FILTER time %]</td>
+ </tr>
+</table>
+
+<h2>Confirmation</h2>
+
+<table border="0" cellpadding="20" width="70%" bgcolor="red">
+ <tr>
+ <td>
+ The content of this attachment will be deleted in an <b>irreversible</b> way.
+ </td>
+ </tr>
+</table>
+
+<p>Do you really want to delete this attachment?</p>
+
+<form action="attachment.cgi" method="POST">
+ <label for="reason">Reason of the deletion:</label>
+ <input type="text" id="reason" name="reason" value="" size="80" maxlength="200">
+ <br>
+ <input type="submit" value="Yes, delete" id="delete">
+ <input type="hidden" name="action" value="delete">
+ <input type="hidden" name="id" value="[% a.id FILTER html %]">
+ <input type="hidden" name="token" value="[% token FILTER html %]">
+</form>
+
+<p>
+ No, cancel this deletion and return to
+ [%+ "$terms.bug " _ a.bug_id FILTER bug_link(a.bug_id) FILTER none %].
+</p>
+
+[% PROCESS global/footer.html.tmpl %]
diff --git a/template/en/default/attachment/create.html.tmpl b/template/en/default/attachment/create.html.tmpl
new file mode 100644
index 0000000..abc0f97
--- /dev/null
+++ b/template/en/default/attachment/create.html.tmpl
@@ -0,0 +1,133 @@
+[%# 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.
+ #%]
+
+[%# Define strings that will serve as the title and header of this page %]
+[% title = BLOCK %]Create New Attachment for [% terms.Bug %] #[% bug.bug_id %][% END %]
+[% header = BLOCK %]Create New Attachment for
+ [%+ "$terms.Bug $bug.bug_id" FILTER bug_link(bug) FILTER none %][% END %]
+[% subheader = BLOCK %][% bug.short_desc FILTER html %][% END %]
+
+[% PROCESS global/header.html.tmpl
+ title = title
+ header = header
+ subheader = subheader
+ style_urls = [ 'skins/standard/attachment.css' ]
+ yui = [ 'autocomplete' ]
+ javascript_urls = [ "js/attachment.js", 'js/field.js', "js/util.js", "js/TUI.js" ]
+ doc_section = "attachments.html"
+%]
+
+<script type="text/javascript">
+<!--
+TUI_hide_default('attachment_text_field');
+-->
+</script>
+
+<form name="entryform" method="post" action="attachment.cgi"
+ enctype="multipart/form-data"
+ onsubmit="return validateAttachmentForm(this)">
+ <input type="hidden" name="bugid" value="[% bug.bug_id %]">
+ <input type="hidden" name="action" value="insert">
+ <input type="hidden" name="token" value="[% token FILTER html %]">
+
+ <table class="attachment_entry">
+ [% PROCESS attachment/createformcontents.html.tmpl %]
+
+ [%# Additional fields for attachments on existing bugs: %]
+ [% IF attachments.size %]
+ <tr>
+ <th>Obsoletes:</th>
+ <td>
+ <em>(optional) Check each existing attachment made obsolete by your new attachment.</em><br>
+ [% FOREACH attachment = attachments %]
+ <input type="checkbox" id="[% attachment.id %]"
+ name="obsolete" value="[% attachment.id %]">
+ <a href="attachment.cgi?id=[% attachment.id %]&amp;action=edit">[% attachment.id %]: [% attachment.description FILTER html %]</a><br>
+ [% END %]
+ </td>
+ </tr>
+ [% END %]
+
+ [% IF (user.id != bug.assigned_to.id) AND user.in_group("editbugs", bug.product_id) %]
+ <tr>
+ <th>Reassignment:</th>
+ <td>
+ <em>If you want to assign this [% terms.bug %] to yourself,
+ check the box below.</em><br>
+ <input type="checkbox" id="takebug" name="takebug" value="1">
+ <label for="takebug">take [% terms.bug %]</label>
+ [% bug_statuses = [] %]
+ [% FOREACH bug_status = bug.status.can_change_to %]
+ [% NEXT IF bug_status.name == "UNCONFIRMED"
+ && !bug.product_obj.allows_unconfirmed %]
+ [% bug_statuses.push(bug_status) IF bug_status.is_open %]
+ [% END %]
+ [% IF bug_statuses.size %]
+ <label for="takebug">and set the [% terms.bug %] status to</label>
+ <select id="bug_status" name="bug_status">
+ <option value="[% bug.status.name FILTER html %]">[% display_value("bug_status", bug.status.name) FILTER html %] (current)</option>
+ [% FOREACH bug_status = bug_statuses %]
+ [% NEXT IF bug_status.id == bug.status.id %]
+ <option value="[% bug_status.name FILTER html %]">[% display_value("bug_status", bug_status.name) FILTER html %]</option>
+ [% END %]
+ </select>
+ [% END %]
+ </td>
+ </tr>
+ [% END %]
+ <tr>
+ <th><label for="comment">Comment:</label></th>
+ <td>
+ <em>(optional) Add a comment about this attachment to the [% terms.bug %].</em><br>
+ [% INCLUDE global/textarea.html.tmpl
+ name = 'comment'
+ id = 'comment'
+ minrows = 6
+ maxrows = 15
+ cols = constants.COMMENT_COLS
+ wrap = 'soft'
+ %]
+ [% IF NOT bug.cc.contains(user.login) %]
+ <br>
+ <input type="checkbox" id="addselfcc" name="addselfcc"
+ [%~ ' checked="checked"'
+ IF user.settings.state_addselfcc.value == 'always'
+ || (!bug.user.has_any_role
+ && user.settings.state_addselfcc.value == 'cc_unless_role') %]>
+ <label for="addselfcc">Add me to CC list</label>
+ [% END %]
+ </td>
+ </tr>
+ [% IF user.is_insider %]
+ <tr>
+ <th>Privacy:</th>
+ <td>
+ <input type="checkbox" name="isprivate" id="isprivate"
+ value="1" onClick="updateCommentPrivacy(this)">
+ <label for="isprivate">
+ Make attachment and comment private (visible only to members of
+ the <strong>[% Param('insidergroup') FILTER html %]</strong>
+ group)
+ </label>
+ </td>
+ </tr>
+ [% END %]
+
+ [% Hook.process('form_before_submit') %]
+
+ <tr>
+ <th>&nbsp;</th>
+ <td><input type="submit" id="create" value="Submit"></td>
+ </tr>
+ </table>
+
+</form>
+
+[% Hook.process('end') %]
+
+[% PROCESS global/footer.html.tmpl %]
diff --git a/template/en/default/attachment/created.html.tmpl b/template/en/default/attachment/created.html.tmpl
new file mode 100644
index 0000000..cbfd260
--- /dev/null
+++ b/template/en/default/attachment/created.html.tmpl
@@ -0,0 +1,54 @@
+[%# 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.
+ #%]
+
+[%# INTERFACE:
+ # attachment: object of the attachment just created.
+ # contenttypemethod: string. How we got the content type of the attachment.
+ # Possible values: autodetect, list, manual.
+ #%]
+
+[% bug = bugs.0 %]
+[% PROCESS "bug/show-header.html.tmpl" %]
+[% PROCESS global/header.html.tmpl
+ title = "Attachment $attachment.id added to $terms.Bug $attachment.bug_id"
+%]
+
+<dl>
+ <dt>
+ <a title="[% attachment.description FILTER html %]"
+ href="attachment.cgi?id=[% attachment.id %]&amp;action=edit">Attachment #[% attachment.id %]</a>
+ to [% "$terms.bug $attachment.bug_id" FILTER bug_link(attachment.bug_id) FILTER none %] created
+ </dt>
+ <dd>
+ [% PROCESS "bug/process/bugmail.html.tmpl" mailing_bugid = attachment.bug_id %]
+ [% IF convertedbmp %]
+ <p>
+ <b>Note:</b> [% terms.Bugzilla %] automatically converted your BMP image file to a
+ compressed PNG format.
+ </p>
+ [% END %]
+ [% IF contenttypemethod == 'autodetect' %]
+ <p>
+ <b>Note:</b> [% terms.Bugzilla %] automatically detected the content type
+ <em>[% attachment.contenttype FILTER html %]</em> for this attachment. If this is
+ incorrect, correct the value by editing the attachment's
+ <a href="attachment.cgi?id=[% attachment.id %]&amp;action=edit">details</a>.
+ </p>
+ [% END %]
+
+ [%# Links to more information about the changed bug. %]
+ [% Hook.process("links") %]
+ </dd>
+</dl>
+
+<p>
+<a href="attachment.cgi?bugid=[% attachment.bug_id %]&amp;action=enter">Create
+ Another Attachment to [% terms.Bug %] [%+ attachment.bug_id %]</a>
+</p>
+
+[% PROCESS bug/show.html.tmpl %]
diff --git a/template/en/default/attachment/createformcontents.html.tmpl b/template/en/default/attachment/createformcontents.html.tmpl
new file mode 100644
index 0000000..48e4f4a
--- /dev/null
+++ b/template/en/default/attachment/createformcontents.html.tmpl
@@ -0,0 +1,98 @@
+[%# 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.
+ #%]
+
+[% max_local = Param('maxlocalattachment') * 1024 %]
+[% max_limit = Param('maxattachmentsize')> max_local ? Param('maxattachmentsize') : max_local %]
+<tr class="attachment_data">
+ <th><label for="data">File</label>:</th>
+ <td>
+ <em>Enter the path to the file on your computer</em> (or
+ <a id="attachment_data_controller" href="javascript:TUI_toggle_class('attachment_text_field');
+ javascript:TUI_toggle_class('attachment_data')"
+ >paste text as attachment</a>).<br>
+ <input type="file" id="data" name="data" size="50" onchange="DataFieldHandler()">
+ <br><em>(File size limit: [% max_limit FILTER html %] KB)</em>
+ </td>
+</tr>
+<tr class="attachment_text_field">
+ <th><label for="attach_text">File</label>:</th>
+ <td>
+ <em>Paste the text to be added as an attachment</em> (or
+ <a id="attachment_text_field_controller" href="javascript:TUI_toggle_class('attachment_text_field');
+ javascript:TUI_toggle_class('attachment_data')"
+ >attach a file</a>).<br>
+ <textarea id="attach_text" name="attach_text" cols="80" rows="15"
+ onkeyup="TextFieldHandler()" onblur="TextFieldHandler()"></textarea>
+ </td>
+</tr>
+<tr>
+ <th class="required"><label for="description">Description</label>:</th>
+ <td>
+ <em>Describe the attachment briefly.</em><br>
+ <input type="text" id="description" name="description" class="required"
+ size="60" maxlength="200">
+ </td>
+</tr>
+<tr[% ' class="expert_fields"' UNLESS bug.id %]>
+ <th>Content Type:</th>
+ <td>
+ <em>If the attachment is a patch, check the box below.</em><br>
+ <input type="checkbox" id="ispatch" name="ispatch" value="1"
+ onchange="setContentTypeDisabledState(this.form);">
+ <label for="ispatch">patch</label><br><br>
+ [%# Reset this whenever the page loads so that the JS state is up to date %]
+ <script type="text/javascript">
+ YAHOO.util.Event.onDOMReady(function() {
+ bz_fireEvent(document.getElementById('ispatch'), 'change');
+ });
+ </script>
+
+ <em>Otherwise, choose a method for determining the content type.</em><br>
+ <input type="radio" id="autodetect"
+ name="contenttypemethod" value="autodetect" checked="checked">
+ <label for="autodetect">auto-detect</label><br>
+ <input type="radio" id="list"
+ name="contenttypemethod" value="list">
+ <label for="list">select from list</label>:
+ <select name="contenttypeselection" id="contenttypeselection"
+ onchange="this.form.contenttypemethod[1].checked = true;">
+ [% PROCESS content_types %]
+ </select><br>
+ <input type="radio" id="manual"
+ name="contenttypemethod" value="manual">
+ <label for="manual">enter manually</label>:
+ <input type="text" name="contenttypeentry" id="contenttypeentry"
+ size="30" maxlength="200"
+ onchange="if (this.value) this.form.contenttypemethod[2].checked = true;">
+ </td>
+</tr>
+<tr[% ' class="expert_fields"' UNLESS bug.id %]>
+ <td> </td>
+ <td>
+ [% IF flag_types && flag_types.size > 0 %]
+ [% PROCESS "flag/list.html.tmpl" %]<br>
+ [% END %]
+ </td>
+</tr>
+
+[% BLOCK content_types %]
+ [% mimetypes = [{type => "text/plain", desc => "plain text"},
+ {type => "text/html", desc => "HTML source"},
+ {type => "application/xml", desc => "XML source"},
+ {type => "image/gif", desc => "GIF image"},
+ {type => "image/jpeg", desc => "JPEG image"},
+ {type => "image/png", desc => "PNG image"},
+ {type => "application/pdf", desc => "PDF document"},
+ {type => "application/octet-stream", desc => "binary file"}]
+ %]
+ [% Hook.process("mimetypes", "attachment/createformcontents.html.tmpl") %]
+
+ [% FOREACH m = mimetypes %]
+ <option value="[% m.type FILTER html %]">[% m.desc FILTER html %] ([% m.type FILTER html %])</option>
+ [% END %]
+[% END %]
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 0000000..1631555
--- /dev/null
+++ b/template/en/default/attachment/delete_reason.txt.tmpl
@@ -0,0 +1,18 @@
+[%# 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.
+ #%]
+
+[%# INTERFACE:
+ # attachment: object of the attachment the user wants to delete.
+ # reason: string; The reason provided by the user.
+ #%]
+
+The content of attachment [% attachment.id %] has been deleted
+[%~ IF reason %] for the following reason:
+
+[%+ reason %]
+[% END %]
diff --git a/template/en/default/attachment/diff-file.html.tmpl b/template/en/default/attachment/diff-file.html.tmpl
new file mode 100644
index 0000000..815b6de
--- /dev/null
+++ b/template/en/default/attachment/diff-file.html.tmpl
@@ -0,0 +1,164 @@
+[%# 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.
+ #%]
+
+[%# This line is really long for a reason: to get rid of any possible textnodes
+ # between the elements. This is necessary because DOM parent-child-sibling
+ # relations can change and screw up the javascript for restoring, collapsing
+ # and expanding. Do not change without testing all three of those.
+ # Also, the first empty row is required because 'table-layout: fixed' only
+ # considers the first row to determine column widths. If a colspan is found,
+ # it then share the width equally among all columns, which we don't want.
+ #%]
+<table class="file_table"><thead><tr><td class="num"></td><td></td><td class="num"></td><td></td></tr><tr><td class="file_head" colspan="4"><a href="#" onclick="return twisty_click(this)">[% collapsed ? '(+)' : '(-)' %]</a><input type="checkbox" name="[% file.filename FILTER html %]"[% collapsed ? '' : ' checked' %] style="display: none">
+ [% IF lxr_prefix && !file.is_add %]
+ <a href="[% lxr_prefix %]">[% file.filename FILTER html %]</a>
+ [% ELSE %]
+ [% file.filename FILTER html %]
+ [% END %]
+ [% IF file.plus_lines %]
+ [% IF file.minus_lines %]
+ (-[% file.minus_lines %]&nbsp;/&nbsp;+[% file.plus_lines %]&nbsp;lines)
+ [% ELSE %]
+ (+[% file.plus_lines %]&nbsp;lines)
+ [% END %]
+ [% ELSE %]
+ [% IF file.minus_lines %]
+ (-[% file.minus_lines %]&nbsp;lines)
+ [% END %]
+ [% END %]
+</td></tr></thead><tbody class="[% collapsed ? 'file_collapse' : 'file' %]">
+<script type="text/javascript">
+incremental_restore()
+</script>
+
+[% section_num = 0 %]
+[% FOREACH section = sections %]
+ [% section_num = section_num + 1 %]
+ <tr><th colspan="4" class="section_head">
+ <table id="[% file.filename FILTER html %]_sec[% section_num %]" cellpadding="0" cellspacing="0">
+ <tr><th width="95%" align="left">
+ [% IF file.is_add %]
+ Added
+ [% ELSIF file.is_remove %]
+ [% IF bonsai_prefix %]
+ <a href="[% bonsai_prefix %]">Removed</a>
+ [% ELSE %]
+ Removed
+ [% END %]
+ [% ELSE %]
+ [% IF bonsai_prefix %]
+ <a href="[% bonsai_prefix %]#[% section.old_start %]">
+ [% END %]
+ [% IF section.old_lines > 1 %]
+ &nbsp;Lines&nbsp;[% section.old_start %]-[% section.old_start +
+ section.old_lines - 1 %]
+ [% ELSE %]
+ Line&nbsp;[% section.old_start %]
+ [% END %]
+ [% IF bonsai_prefix %]
+ </a>
+ [% END %]
+ &nbsp;&nbsp;[% section.func_info FILTER html IF section.func_info %]
+ [% END %]
+ </th><th>
+ <a href="#[% file.filename FILTER html %]_sec[% section_num %]">Link&nbsp;Here</a>&nbsp;
+ </th></tr></table>
+ </th></tr>
+ [% current_line_old = section.old_start %]
+ [% current_line_new = section.new_start %]
+ [% FOREACH group = section.groups %]
+ [% IF group.context %]
+ [% FOREACH line = group.context %]
+ <tr>
+ <td class="num">[% current_line_old %]</td>
+ <td><pre>[% line FILTER html %]</pre></td>
+ <td class="num">[% current_line_new %]</td>
+ <td><pre>[% line FILTER html %]</pre></td>
+ </tr>
+ [% current_line_old = current_line_old + 1 %]
+ [% current_line_new = current_line_new + 1 %]
+ [% END %]
+ [% END %]
+ [% IF group.plus.size %]
+ [% IF group.minus.size %]
+ [% i = 0 %]
+ [% WHILE (i < group.plus.size || i < group.minus.size) %]
+ [%# WHILE cannot loop more than 1000 times by default, so we break it every 500 times. %]
+ [% currentloop = 0 %]
+ [% WHILE currentloop < 500 && (i < group.plus.size || i < group.minus.size) %]
+ <tr>
+ [% IF i < group.minus.size %]
+ <td class="num">[% current_line_old + i %]</td>
+ <td class="changed"><pre>[% group.minus.$i FILTER html %]</pre></td>
+ [% ELSIF i == group.minus.size %]
+ [% rowspan = group.plus.size - group.minus.size %]
+ <td class="num"[% IF rowspan > 1 %] rowspan="[% rowspan FILTER none %]"[% END %]></td>
+ <td class="changed"[% IF rowspan > 1 %] rowspan="[% rowspan FILTER none %]"[% END %]></td>
+ [% END %]
+
+ [% IF i < group.plus.size %]
+ <td class="num">[% current_line_new + i %]</td>
+ <td class="changed"><pre>[% group.plus.$i FILTER html %]</pre></td>
+ [% ELSIF i == group.plus.size %]
+ [% rowspan = group.minus.size - group.plus.size %]
+ <td class="num"[% IF rowspan > 1 %] rowspan="[% rowspan FILTER none %]"[% END %]></td>
+ <td class="changed"[% IF rowspan > 1 %] rowspan="[% rowspan FILTER none %]"[% END %]></td>
+ [% END %]
+ </tr>
+ [% currentloop = currentloop + 1 %]
+ [% i = i + 1 %]
+ [% END %]
+ [% END %]
+ [% current_line_old = current_line_old + group.minus.size %]
+ [% current_line_new = current_line_new + group.plus.size %]
+ [% ELSE %]
+ [% FOREACH line = group.plus %]
+ [% IF file.is_add %]
+ <tr>
+ <td class="num">[% current_line_new %]</td>
+ <td class="added" colspan="3"><pre>[% line FILTER html %]</pre></td>
+ </tr>
+ [% ELSE %]
+ <tr>
+ [% IF loop.first %]
+ <td class="num"[% IF group.plus.size > 1 %] rowspan="[% group.plus.size %]"[% END %]></td>
+ <td[% IF group.plus.size > 1 %] rowspan="[% group.plus.size %]"[% END %]></td>
+ [% END %]
+ <td class="num">[% current_line_new %]</td>
+ <td class="added"><pre>[% line FILTER html %]</pre></td>
+ </tr>
+ [% END %]
+ [% current_line_new = current_line_new + 1 %]
+ [% END %]
+ [% END %]
+ [% ELSE %]
+ [% IF group.minus.size %]
+ [% FOREACH line = group.minus %]
+ [% IF file.is_remove %]
+ <tr>
+ <td class="num">[% current_line_old %]</td>
+ <td class="removed" colspan="3"><pre>[% line FILTER html %]</pre></td>
+ </tr>
+ [% ELSE %]
+ <tr>
+ <td class="num">[% current_line_old %]</td>
+ <td class="removed"><pre>[% line FILTER html %]</pre></td>
+ [% IF loop.first %]
+ <td class="num"[% IF group.minus.size > 1 %] rowspan="[% group.minus.size %]"[% END %]></td>
+ <td[% IF group.minus.size > 1 %] rowspan="[% group.minus.size %]"[% END %]></td>
+ [% END %]
+ </tr>
+ [% END %]
+ [% current_line_old = current_line_old + 1 %]
+ [% END %]
+ [% END %]
+ [% END %]
+ [% END %]
+[% END %]
+
+</table>
diff --git a/template/en/default/attachment/diff-footer.html.tmpl b/template/en/default/attachment/diff-footer.html.tmpl
new file mode 100644
index 0000000..0e95423
--- /dev/null
+++ b/template/en/default/attachment/diff-footer.html.tmpl
@@ -0,0 +1,21 @@
+[%# 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.
+ #%]
+
+</form>
+
+[% IF headers %]
+
+ <br>
+ <span>Return to [% "$terms.bug $bugid" FILTER bug_link(bugid) FILTER none %]</span>
+
+ [% PROCESS global/footer.html.tmpl %]
+
+[% ELSE %]
+</body>
+</html>
+[% END %]
diff --git a/template/en/default/attachment/diff-header.html.tmpl b/template/en/default/attachment/diff-header.html.tmpl
new file mode 100644
index 0000000..ed4d44e
--- /dev/null
+++ b/template/en/default/attachment/diff-header.html.tmpl
@@ -0,0 +1,139 @@
+[%# 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.
+ #%]
+
+[%# Define strings that will serve as the title and header of this page %]
+
+[% title = BLOCK %]
+ [% IF attachid %]
+Attachment #[% attachid %] for [% terms.bug %] #[% bugid %]
+ [% ELSE %]
+Interdiff of #[% oldid %] and #[% newid %] for [% terms.bug %] #[% bugid %]
+ [% END %]
+[% END %]
+
+[% onload = 'restore_all(); document.checkboxform.restore_indicator.checked = true' %]
+
+[% BLOCK viewurl %]attachment.cgi?id=[% id %][% END %]
+[% BLOCK editurl %][% PROCESS viewurl %]&amp;action=edit[% END %]
+[% BLOCK diffurl %][% PROCESS viewurl %]&amp;action=diff[% END %]
+
+[% IF headers %]
+ [% header = BLOCK %]
+ [% IF attachid %]
+ Attachment #[% attachid %]: [% description FILTER html %]
+ [% ELSE %]
+ Diff Between
+ #[% oldid %]: <a href="[% PROCESS diffurl id=oldid %]">[% old_desc FILTER html %]</a>
+ and
+ #[% newid %]: <a href="[% PROCESS diffurl id=newid %]">[% new_desc FILTER html %]</a>
+ [% END %]
+ for <a href="show_bug.cgi?id=[% bugid %]">[% terms.bug %] #[% bugid %]</a>
+ [% END %]
+ [% subheader = BLOCK %]
+ [% bugsummary FILTER html %]
+ [% END %]
+ [% PROCESS global/header.html.tmpl doc_section = "attachments.html#patchviewer"
+ javascript_urls = "js/attachment.js"
+ style_urls = ['skins/standard/attachment.css'] %]
+[% ELSE %]
+ <html>
+ <head>
+ <link href="[% 'skins/standard/attachment.css' FILTER mtime %]"
+ rel="stylesheet" type="text/css">
+ <script src="[% 'js/attachment.js' FILTER mtime %]"
+ type="text/javascript"></script>
+ </head>
+ <body onload="[% onload FILTER html %]">
+[% END %]
+
+[%# If we have attachid, we are in diff, otherwise we're in interdiff %]
+[% IF attachid %]
+ [%# HEADER %]
+ [% IF headers %]
+ <a href="[% PROCESS viewurl id=attachid %]">View</a>
+ | <a href="[% PROCESS editurl id=attachid %]">Details</a>
+ | <a href="[% PROCESS diffurl id=attachid %]&amp;context=[% context FILTER uri %]&amp;collapsed=[% collapsed FILTER uri %]&amp;headers=[% headers FILTER uri %]&amp;format=raw">Raw&nbsp;Unified</a>
+ | Return to [% "$terms.bug $bugid" FILTER bug_link(bugid) FILTER none %]
+ [% END %]
+ [% IF other_patches.size > 0 %]
+ [% IF headers %] |[%END%]
+ Differences between
+ <form style="display: inline" action="attachment.cgi">
+ <select name="oldid">
+ [% FOREACH patch = other_patches %]
+ <option value="[% patch.id %]"
+ [% IF patch.selected %] selected[% END %]
+ >[% patch.desc FILTER html %]</option>
+ [% END %]
+ </select>
+ and this patch
+ <input type="submit" id="diff" value="Diff">
+ <input type="hidden" name="action" value="interdiff">
+ <input type="hidden" name="newid" value="[% attachid %]">
+ <input type="hidden" name="headers" value="[% headers FILTER html %]">
+ </form>
+ [% END %]
+ <br>
+[% ELSE %]
+ [% IF headers %]
+ <a href="attachment.cgi?oldid=[% oldid %]&amp;newid=[% newid %]&amp;action=interdiff&amp;format=raw">Raw Unified</a>
+ | Return to [% "$terms.bug $bugid" FILTER bug_link(bugid) FILTER none %]
+ |
+ [% END %]
+[% END %]
+
+[%# Collapse / Expand %]
+<a href="#"
+ onmouseover="lastStatus = window.status; window.status='Collapse All'; return true"
+ onmouseout="window.status = lastStatus; return true"
+ onclick="return collapse_all()">Collapse All</a> |
+<a href="#"
+ onmouseover="lastStatus = window.status; window.status='Expand All'; return true"
+ onmouseout="window.status = lastStatus; return true"
+ onclick="return expand_all()">Expand All</a>
+
+[% IF do_context %]
+ [%# only happens for normal viewing, not interdiff %]
+ | <span style='font-weight: bold'>Context:</span>
+ [% IF context == "patch" %]
+ (<strong>Patch</strong> /
+ [% ELSE %]
+ (<a href="[% PROCESS diffurl id=attachid %]&amp;headers=[% headers FILTER uri %]">Patch</a> /
+ [% END %]
+ [% IF context == "file" %]
+ <strong>File</strong> /
+ [% ELSE %]
+ <a href="[% PROCESS diffurl id=attachid %]&amp;headers=[% headers FILTER uri %]&amp;context=file">File</a> /
+ [% END %]
+
+ [% IF context == "patch" || context == "file" %]
+ [% context = 3 %]
+ [% END %]
+ [%# textbox for context %]
+ <form style="display: inline" action="attachment.cgi"><input type="hidden" name="action" value="diff"><input type="hidden" name="id" value="[% attachid %]"><input type="hidden" name="collapsed" value="[% collapsed FILTER html %]"><input type="hidden" name="headers" value="[% headers FILTER html %]"><input type="text" name="context" value="[% context FILTER html %]" size="3"></form>)
+[% END %]
+
+[% IF warning %]
+<h2 class="warning">Warning:
+ [% IF warning == "interdiff1" %]
+ this difference between two patches may show things in the wrong places due
+ to a limitation in [% terms.Bugzilla %] when comparing patches with different
+ sets of files.
+ [% END %]
+ [% IF warning == "interdiff2" %]
+ this difference between two patches may be inaccurate due to a limitation in
+ [%+ terms.Bugzilla %] when comparing patches made against different revisions.
+ [% END %]
+</h2>
+[% ELSE %]
+ <br><br>
+[% END %]
+
+[%# Restore Stuff %]
+<form name="checkboxform" action="attachment.cgi">
+<input type="checkbox" name="restore_indicator" style="display: none">
diff --git a/template/en/default/attachment/edit.html.tmpl b/template/en/default/attachment/edit.html.tmpl
new file mode 100644
index 0000000..5187377
--- /dev/null
+++ b/template/en/default/attachment/edit.html.tmpl
@@ -0,0 +1,331 @@
+[%# 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.
+ #%]
+
+[%# 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', 'js/field.js']
+ style_urls = ['skins/standard/attachment.css']
+ yui = [ 'autocomplete' ]
+ 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" %]
+
+<form method="post" action="attachment.cgi" onsubmit="normalizeComments();">
+ <input type="hidden" name="id" value="[% attachment.id %]">
+ <input type="hidden" name="action" value="update">
+ <input type="hidden" name="contenttypemethod" value="manual">
+ <input type="hidden" name="delta_ts" value="[% attachment.modification_time FILTER html %]">
+ [% IF user.id %]
+ <input type="hidden" name="token" value="[% issue_hash_token([attachment.id, attachment.modification_time]) FILTER html %]">
+ [% END %]
+
+ <div id="attachment_info" class="attachment_info [% IF can_edit %] edit[% ELSE %] read[% END%]">
+ <div id="attachment_attributes">
+ <div id="attachment_information_read_only" class="[% "bz_private" IF attachment.isprivate %]">
+ <div class="title">
+ [% "[patch]" IF attachment.ispatch%]
+ <span class="[% "bz_obsolete" IF attachment.isobsolete %]" title="[% "obsolete" IF attachment.isobsolete %]">
+ [% attachment.description FILTER html %]
+ </span>
+ [% IF can_edit %]
+ <span class="bz_edit">(<a href="javascript:toggle_attachment_details_visibility()">edit details</a>)</span>
+ [% END %]
+ </div>
+ <div class="details">
+ [% attachment.filename FILTER html %] ([% attachment.contenttype FILTER html %]),
+ [% IF attachment.datasize %]
+ [%+ attachment.datasize FILTER unitconvert %]
+ [% ELSE %]
+ <em>deleted</em>
+ [% END %], created by [%+ INCLUDE global/user.html.tmpl who = attachment.attacher %] on [%+ attachment.attached FILTER time %]
+ [% IF attachment.isprivate %];
+ <span class="bz_private">only visible to <strong>[% Param('insidergroup') FILTER html %]</strong> members</span>
+ [% END %]
+ </div>
+ </div>
+ <div id="attachment_information_edit">
+ <span class="bz_hide">
+ (<a href="javascript:toggle_attachment_details_visibility();">hide</a>)
+ </span>
+ <div id="attachment_description">
+ <label for="description">Description:</label>&nbsp;
+ [% INCLUDE global/textarea.html.tmpl
+ id = 'description'
+ name = 'description'
+ minrows = 3
+ cols = 25
+ wrap = 'soft'
+ classes = 'block' _ editable_or_hide
+ defaultcontent = attachment.description
+ %]
+ </div>
+
+ <div id="attachment_filename">
+ <label for="filename">Filename:</label>
+ <input type="text" size="20" class="text block[% editable_or_hide %]"
+ id="filename" name="filename"
+ value="[% attachment.filename FILTER html %]">
+ </div>
+
+ <div id="attachment_mimetype">
+ <label for="contenttypeentry">MIME Type:</label>
+ <input type="text" size="20" class="text block[% editable_or_hide %]"
+ id="contenttypeentry" name="contenttypeentry"
+ value="[% attachment.contenttype FILTER html %]">
+ </div>
+
+ <div id="attachment_creator">
+ <span class="label">Creator:</span>
+ [%+ INCLUDE global/user.html.tmpl who = attachment.attacher %]
+ </div>
+
+ <div id="attachment_created">
+ <span class="label">Created:</span>
+ [%+ attachment.attached FILTER time %]
+ </div>
+
+ <div id="attachment_size">
+ <span class="label">Size:</span>
+ [% IF attachment.datasize %]
+ [%+ attachment.datasize FILTER unitconvert %]
+ [% ELSE %]
+ <em>deleted</em>
+ [% END %]
+ </div>
+
+ <div id="attachment_ispatch">
+ <input type="checkbox" id="ispatch" name="ispatch" value="1"
+ [%+ 'checked="checked"' IF attachment.ispatch %]>
+ <label for="ispatch">patch</label>
+ </div>
+
+ <div class="readonly">
+ <div class="checkboxes">
+ <div id="attachment_isobsolete">
+ <input type="checkbox" id="isobsolete" name="isobsolete" value="1"
+ [%+ 'checked="checked"' IF attachment.isobsolete %]>
+ <label for="isobsolete">obsolete</label>
+ </div>
+
+ [% IF user.is_insider %]
+ <div id="attachment_isprivate">
+ <input type="checkbox" id="isprivate" name="isprivate" value="1"
+ [%+ 'checked="checked"' IF attachment.isprivate %]>
+ [% IF can_edit %]
+ <label for="isprivate">private (only visible to
+ <strong>[% Param('insidergroup') FILTER html %]</strong>)
+ </label>
+ [% ELSE %]
+ <span class="label">Is Private:</span>
+ [%+ attachment.isprivate ? "yes" : "no" %]
+ [% END %]
+ </div>
+ [% END %]
+ </div>
+ </div>
+ </div>
+
+ <div id="attachment_view_window">
+ [% IF !attachment.datasize %]
+ <div><b>The content of this attachment has been deleted.</b></div>
+ [% ELSIF !Param("allow_attachment_display") %]
+ <div id="view_disabled">
+ <p><b>
+ The attachment is not viewable in your browser due to security
+ restrictions enabled by your [% terms.Bugzilla %] administrator.
+ </b></p>
+ <p><b>
+ In order to view the attachment, you first have to
+ <a href="attachment.cgi?id=[% attachment.id %]">download it</a>.
+ </b></p>
+ </div>
+ [% ELSIF attachment.is_viewable %]
+ <div>
+ [% 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
+ %]
+ [% IF attachment.contenttype == 'text/plain' AND is_safe_url(attachment.data) %]
+ <p>
+ <a href="[% attachment.data FILTER html %]">
+ [% IF attachment.datasize < 120 %]
+ [% attachment.data FILTER html %]
+ [% ELSE %]
+ [% attachment.data FILTER truncate(80) FILTER html %]
+ ...
+ [% attachment.data.match('.*(.{20})$').0 FILTER html %]
+ [% END %]
+ </a>
+ </p>
+ [% ELSIF attachment.contenttype == "text/html" %]
+ [%# For security reasons (clickjacking, embedded scripts), we never
+ # render HTML pages from here. The source code is displayed instead. %]
+ [% INCLUDE global/textarea.html.tmpl
+ id = 'viewFrame'
+ minrows = 10
+ cols = 80
+ defaultcontent = attachment.data
+ readonly = 'readonly'
+ %]
+ [% ELSE %]
+ <iframe id="viewFrame" src="attachment.cgi?id=[% attachment.id %]">
+ <b>You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
+ <a href="attachment.cgi?id=[% attachment.id %]">View the attachment on a separate page</a>.</b>
+ </iframe>
+ [% END %]
+ <script type="text/javascript">
+ <!--
+ var patchviewerinstalled = 0;
+ var attachment_id = [% attachment.id %];
+ if (typeof document.getElementById == "function") {
+ [% IF use_patchviewer %]
+ var patchviewerinstalled = 1;
+ document.write('<iframe id="viewDiffFrame" class="bz_default_hidden"><\/iframe>');
+ [% END %]
+ [% IF user.id %]
+ document.write('<button type="button" id="editButton" onclick="editAsComment(patchviewerinstalled);">Edit Attachment As Comment<\/button>');
+ document.write('<button type="button" id="undoEditButton" onclick="undoEditAsComment(patchviewerinstalled);" class="bz_default_hidden">Undo Edit As Comment<\/button>');
+ document.write('<button type="button" id="redoEditButton" onclick="redoEditAsComment(patchviewerinstalled);" class="bz_default_hidden">Redo Edit As Comment<\/button>');
+ var editFrame = document.getElementById('editFrame');
+ if (editFrame) {
+ editFrame.disabled = false;
+ }
+ [% END %]
+ [% IF use_patchviewer %]
+ document.write('<button type="button" id="viewDiffButton" onclick="viewDiff(attachment_id, patchviewerinstalled);">View Attachment As Diff<\/button>');
+ [% END %]
+ document.write('<button type="button" id="viewRawButton" onclick="viewRaw(patchviewerinstalled);" class="bz_default_hidden">View Attachment As Raw<\/button>');
+ }
+ //-->
+ </script>
+ </div>
+ [% ELSE %]
+ <div id="noview">
+ <p><b>
+ 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.
+ </b></p>
+ <p><b>
+ <a href="attachment.cgi?id=[% attachment.id %]">Download the attachment</a>.
+ </b></p>
+ </div>
+ [% END %]
+ </div>
+ <div id="attachment_comments_and_flags">
+ [% IF user.id %]
+ <div id="smallCommentFrame" >
+ <label for="comment">Comment (on the [% terms.bug %]):</label>
+ [% 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
+ %]
+ [% IF NOT attachment.bug.cc.contains(user.login) %]
+ <input type="checkbox" id="addselfcc" name="addselfcc"
+ [%~ ' checked="checked"'
+ IF user.settings.state_addselfcc.value == 'always'
+ || (!attachment.bug.user.has_any_role
+ && user.settings.state_addselfcc.value == 'cc_unless_role') %]>
+ <label for="addselfcc">Add me to CC list</label>
+ [% END %]
+ </div>
+ [% END %]
+ <div id="attachment_flags">
+ [% IF attachment.flag_types.size > 0 %]
+ [% PROCESS "flag/list.html.tmpl" flag_types = attachment.flag_types
+ read_only_flags = !can_edit
+ %]
+
+ [% END %]
+ </div>
+
+ [% Hook.process('form_before_submit') %]
+
+ [% IF user.id %]
+ <div id="update_container">
+ <input type="submit" value="Submit" id="update">
+ </div>
+ [% END %]
+ </div>
+ </div>
+ </div>
+</form>
+
+<div id="attachment_actions">
+ <span class="label">Actions:</span>
+ <a href="attachment.cgi?id=[% attachment.id %]">View</a>
+ [% IF use_patchviewer %]
+ | <a href="attachment.cgi?id=[% attachment.id %]&amp;action=diff">Diff</a>
+ [% END %]
+ [% IF Param("allow_attachment_deletion")
+ && user.in_group('admin')
+ && attachment.datasize > 0 %]
+ | <a href="attachment.cgi?id=[% attachment.id %]&amp;action=delete">Delete</a>
+ [% END %]
+ [% Hook.process('action') %]
+</div>
+
+<div id="attachment_list">
+ Attachments on [% "$terms.bug ${attachment.bug_id}" FILTER bug_link(attachment.bug_id) FILTER none %]:
+ [% FOREACH a = attachments %]
+ [% IF a.isobsolete %]
+ <span class="bz_obsolete">
+ [% END %]
+ [% IF a.id == attachment.id %]
+ [%+ a.id FILTER html %]
+ [% ELSE %]
+ <a href="attachment.cgi?id=[% a.id FILTER uri %]&amp;action=edit"
+ title="[% a.description FILTER html %]">[% a.id FILTER html %]</a>
+ [% END %]
+ [% IF a.isobsolete %]
+ </span>
+ [% END %]
+ [% " |" UNLESS loop.last() %]
+ [% END %]
+</div>
+[% IF can_edit %]
+ <script type="text/javascript">
+ <!--
+ YAHOO.util.Dom.removeClass( document.body, "no_javascript" );
+ toggle_attachment_details_visibility( );
+ -->
+ </script>
+[% END %]
+[% Hook.process('end') %]
+
+[% PROCESS global/footer.html.tmpl %]
diff --git a/template/en/default/attachment/list.html.tmpl b/template/en/default/attachment/list.html.tmpl
new file mode 100644
index 0000000..e30492c
--- /dev/null
+++ b/template/en/default/attachment/list.html.tmpl
@@ -0,0 +1,165 @@
+[%# 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 attachments.size || Param("maxattachmentsize") || Param("maxlocalattachment") %]
+
+<script type="text/javascript">
+<!--
+function toggle_display(link) {
+ var table = document.getElementById("attachment_table");
+ var view_all = document.getElementById("view_all");
+ var hide_obsolete_url_parameter = "&hide_obsolete=1";
+ // Store current height for scrolling later
+ var originalHeight = table.offsetHeight;
+ var rows = YAHOO.util.Dom.getElementsByClassName(
+ 'bz_tr_obsolete', 'tr', table);
+
+ for (var i = 0; i < rows.length; i++) {
+ bz_toggleClass(rows[i], 'bz_default_hidden');
+ }
+
+ if (YAHOO.util.Dom.hasClass(rows[0], 'bz_default_hidden')) {
+ link.innerHTML = "Show Obsolete";
+ view_all.href = view_all.href + hide_obsolete_url_parameter
+ }
+ else {
+ link.innerHTML = "Hide Obsolete";
+ view_all.href = view_all.href.replace(hide_obsolete_url_parameter,"");
+ }
+
+ var newHeight = table.offsetHeight;
+ // This scrolling makes the window appear to not move at all.
+ window.scrollBy(0, newHeight - originalHeight);
+
+ return false;
+}
+//-->
+</script>
+
+<br>
+<table id="attachment_table" cellspacing="0" cellpadding="4">
+ <tr id="a0">
+ <th colspan="[% show_attachment_flags ? 3 : 2 %]" align="left">
+ Attachments
+ </th>
+ </tr>
+
+ [% count = 0 %]
+ [% obsolete_attachments = 0 %]
+ [% user_cache = template_cache.users %]
+
+ [% FOREACH attachment = attachments %]
+ [% count = count + 1 %]
+ [% IF !attachment.isprivate || user.is_insider || attachment.attacher.id == user.id %]
+ [% IF attachment.isobsolete %]
+ [% obsolete_attachments = obsolete_attachments + 1 %]
+ [% END %]
+ <tr id="a[% count %]" class="[% "bz_contenttype_" _ attachment.contenttype
+ FILTER css_class_quote %]
+ [% " bz_patch" IF attachment.ispatch %]
+ [% " bz_private" IF attachment.isprivate %]
+ [% " bz_tr_obsolete bz_default_hidden"
+ IF attachment.isobsolete %]">
+ <td valign="top">
+ [% IF attachment.datasize %]
+ <a href="attachment.cgi?id=[% attachment.id %]"
+ title="View the content of the attachment">
+ [% END %]
+ <b>[% attachment.description FILTER html FILTER obsolete(attachment.isobsolete) %]</b>
+ [% "</a>" IF attachment.datasize %]
+
+ <span class="bz_attach_extra_info">
+ [% IF attachment.datasize %]
+ ([% attachment.datasize FILTER unitconvert %],
+ [% IF attachment.ispatch %]
+ patch)
+ [% ELSE %]
+ [%+ attachment.contenttype FILTER html %])
+ [% END %]
+ [% ELSE %]
+ (<em>deleted</em>)
+ [% END %]
+
+ <br>
+ <a href="#attach_[% attachment.id %]"
+ title="Go to the comment associated with the attachment">
+ [%- attachment.attached FILTER time %]</a>,
+
+ [%# No need to recreate the exact same template if we already have it. %]
+ [% attacher_id = attachment.attacher.id %]
+ [% UNLESS user_cache.$attacher_id %]
+ [% user_cache.$attacher_id = BLOCK %]
+ [% INCLUDE global/user.html.tmpl who = attachment.attacher %]
+ [% END %]
+ [% END %]
+ [% user_cache.$attacher_id FILTER none %]
+ </span>
+ </td>
+
+ [% IF show_attachment_flags %]
+ <td class="bz_attach_flags" valign="top">
+ [% IF attachment.flags.size == 0 %]
+ <i>no flags</i>
+ [% ELSE %]
+ [% FOREACH flag = attachment.flags %]
+ [% IF user.id %]
+ <span title="[% flag.setter.identity FILTER html %]">[% flag.setter.nick FILTER html %]</span>:
+ [% ELSIF flag.setter.name %]
+ <span title="[% flag.setter.name FILTER html %]">[% flag.setter.nick FILTER html %]</span>:
+ [% ELSE %]
+ [% flag.setter.nick FILTER html %]:
+ [% END %]
+ [%+ flag.type.name FILTER html FILTER no_break %][% flag.status %]
+ [%+ IF flag.status == "?" && flag.requestee %]
+ [% IF user.id %]
+ (<span title="[% flag.requestee.identity FILTER html %]">[% flag.requestee.nick FILTER html %]</span>)
+ [% ELSIF flag.requestee.name %]
+ (<span title="[% flag.requestee.name FILTER html %]">[% flag.requestee.nick FILTER html %]</span>)
+ [% ELSE %]
+ ([% flag.requestee.nick FILTER html %])
+ [% END %]
+ [% END %]<br>
+ [% END %]
+ [% END %]
+ </td>
+ [% END %]
+
+ <td valign="top">
+ <a href="attachment.cgi?id=[% attachment.id %]&amp;action=edit">Details</a>
+ [% IF attachment.ispatch && feature_enabled('patch_viewer') %]
+ | <a href="attachment.cgi?id=[% attachment.id %]&amp;action=diff">Diff</a>
+ [% END %]
+ [% Hook.process("action") %]
+ </td>
+ </tr>
+ [% END %]
+ [% END %]
+
+ <tr class="bz_attach_footer">
+ <td colspan="[% show_attachment_flags ? 3 : 2 %]">
+ [% IF attachments.size %]
+ <span class="bz_attach_view_hide">
+ [% IF obsolete_attachments %]
+ <a href="#a0" onclick="return toggle_display(this);">Show
+ Obsolete</a> ([% obsolete_attachments %])
+ [% END %]
+ [% IF Param("allow_attachment_display") %]
+ <a id="view_all" href="attachment.cgi?bugid=
+ [%- bugid %]&amp;action=viewall
+ [%- "&amp;hide_obsolete=1" IF obsolete_attachments %]">View All</a>
+ [% END %]
+ </span>
+ [% END %]
+ [% IF Param("maxattachmentsize") || Param("maxlocalattachment") %]
+ <a href="attachment.cgi?bugid=[% bugid %]&amp;action=enter">Add an attachment</a>
+ (proposed patch, testcase, etc.)
+ [% END %]
+ </td>
+ </tr>
+</table>
+<br>
diff --git a/template/en/default/attachment/midair.html.tmpl b/template/en/default/attachment/midair.html.tmpl
new file mode 100644
index 0000000..68db5d9
--- /dev/null
+++ b/template/en/default/attachment/midair.html.tmpl
@@ -0,0 +1,64 @@
+[%# 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.
+ #%]
+
+[%# INTERFACE:
+ # operations: array; bug activity since the user last displayed the attachment form,
+ # used by bug/activity/table.html.tmpl to display recent changes that will
+ # be overwritten if the user submits these changes. See that template
+ # for further documentation.
+ # attachment: object; the attachment being changed.
+ #%]
+
+[%# The global Bugzilla->cgi object is used to obtain form variable values. %]
+[% USE Bugzilla %]
+[% cgi = Bugzilla.cgi %]
+
+[% PROCESS global/header.html.tmpl title = "Mid-air collision!" %]
+
+<h1>Mid-air collision detected!</h1>
+
+<p>
+ Someone else has made changes to
+ <a href="attachment.cgi?id=[% attachment.id %]&amp;action=edit">attachment [% attachment.id %]</a>
+ of [% "$terms.bug $attachment.bug_id" FILTER bug_link(attachment.bug_id) FILTER none %]
+ at the same time you were trying to. The changes made were:
+</p>
+
+<p>
+ [% PROCESS "bug/activity/table.html.tmpl" incomplete_data=0 %]
+</p>
+
+[% IF cgi.param("comment") %]
+<p>
+ Your comment was:<br>
+ <blockquote><pre class="bz_comment_text">
+ [% cgi.param("comment") FILTER html %]
+ </pre></blockquote>
+</p>
+[% END %]
+
+<p>
+You have the following choices:
+</p>
+
+<ul>
+ <li>
+ <form method="post" action="attachment.cgi">
+ [% PROCESS "global/hidden-fields.html.tmpl" exclude="^Bugzilla_(login|password)$" %]
+ <input type="submit" id="process" value="Submit my changes anyway">
+ This will cause all of the above changes to be overwritten.
+ </form>
+ </li>
+ <li>
+ Throw away my changes, and
+ <a href="attachment.cgi?id=[% attachment.id %]&amp;action=edit">revisit
+ attachment [% attachment.id %]</a>
+ </li>
+</ul>
+
+[% PROCESS global/footer.html.tmpl %]
diff --git a/template/en/default/attachment/show-multiple.html.tmpl b/template/en/default/attachment/show-multiple.html.tmpl
new file mode 100644
index 0000000..8791e0d
--- /dev/null
+++ b/template/en/default/attachment/show-multiple.html.tmpl
@@ -0,0 +1,106 @@
+[%# 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.
+ #%]
+
+[% filtered_summary = bugsummary FILTER html %]
+[% header = BLOCK %]View All Attachments for
+ [%+ "$terms.Bug $bug.id" FILTER bug_link(bug) FILTER none %][% END %]
+
+[% title = BLOCK %]
+ View All Attachments for [% terms.Bug %] [%+ bug.bug_id FILTER html %]
+[% END %]
+
+[% PROCESS global/header.html.tmpl
+ title = title
+ header = header
+ subheader = filtered_summary
+ style_urls = ['skins/standard/attachment.css']
+%]
+[% IF hide_obsolete %]
+ <div id="hidden_obsolete_message">
+ Obsolete attachments are hidden. To view all attachments (including obsolete)
+ <a href="attachment.cgi?bugid=[% bug.id FILTER html %]&amp;action=viewall">click here</a>.
+ </div>
+[% END %]
+<br>
+
+[% FOREACH a = attachments %]
+
+ <div align="center">
+ <table class="attachment_info" cellspacing="0" cellpadding="4" border="1" width="75%">
+ <tr>
+ <td valign="top" bgcolor="#cccccc" colspan="6">
+ <big><b>Attachment #[% a.id %]</b></big>
+ </td>
+ </tr>
+ <tr>
+ <td valign="top">
+ [% a.description FILTER html FILTER obsolete(a.isobsolete) %]
+ </td>
+
+ <td valign="top">
+ [% IF a.ispatch %]
+ <i>patch</i>
+ [% ELSE %]
+ [% a.contenttype FILTER html %]
+ [% END %]
+ </td>
+
+ <td valign="top">[% a.attached FILTER time %]</td>
+ <td valign="top">[% a.datasize FILTER unitconvert %]</td>
+
+ <td valign="top">
+ [% IF a.flags.size == 0 %]
+ <i>no flags</i>
+ [% ELSE %]
+ [% FOREACH flag = a.flags %]
+ [% flag.setter.nick FILTER html %]:
+ [%+ flag.type.name FILTER html %][% flag.status %]
+ [% IF flag.status == "?" && flag.requestee %]
+ ([% flag.requestee.nick FILTER html %])
+ [% END %]
+ [% ", " IF !loop.last %]
+ [% END %]
+ [% END %]
+ </td>
+
+ <td valign="top">
+ <a href="attachment.cgi?id=[% a.id %]&amp;action=edit">Details</a>
+ </td>
+ </tr>
+ </table>
+
+ [% IF a.is_viewable %]
+ [% IF a.contenttype == "text/html" %]
+ [%# For security reasons (clickjacking, embedded scripts), we never
+ # render HTML pages from here. The source code is displayed instead. %]
+ [% INCLUDE global/textarea.html.tmpl
+ minrows = 10
+ cols = 80
+ defaultcontent = a.data
+ readonly = 'readonly'
+ classes = 'viewall_frame'
+ %]
+ [% ELSE %]
+ <iframe src="attachment.cgi?id=[% a.id %]" class="viewall_frame">
+ <b>You cannot view the attachment on this page because your browser does not support IFRAMEs.
+ <a href="attachment.cgi?id=[% a.id %]">View the attachment on a separate page</a>.</b>
+ </iframe>
+ [% END %]
+ [% ELSE %]
+ <p><b>
+ Attachment cannot be viewed because its MIME type is not text/*, image/*, or application/vnd.mozilla.*.
+ <a href="attachment.cgi?id=[% a.id %]">Download the attachment instead</a>.
+ </b></p>
+ [% END %]
+ </div>
+
+ <br><br>
+
+[% END %]
+
+[% PROCESS global/footer.html.tmpl %]
diff --git a/template/en/default/attachment/updated.html.tmpl b/template/en/default/attachment/updated.html.tmpl
new file mode 100644
index 0000000..af1cbcd
--- /dev/null
+++ b/template/en/default/attachment/updated.html.tmpl
@@ -0,0 +1,32 @@
+[%# 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.
+ #%]
+
+[%# INTERFACE:
+ # attachment: object of the attachment we just attached.
+ #%]
+
+[% bug = bugs.0 %]
+
+[% PROCESS "bug/show-header.html.tmpl" %]
+[% PROCESS global/header.html.tmpl
+ title = "Changes Submitted to Attachment $attachment.id of $terms.Bug $attachment.bug_id"
+%]
+
+<dl>
+ <dt>Changes to
+ <a href="attachment.cgi?id=[% attachment.id %]&amp;action=edit">attachment [% attachment.id %]</a>
+ of [% "$terms.bug $attachment.bug_id" FILTER bug_link(attachment.bug_id) FILTER none %] submitted
+ </dt>
+ <dd>
+ [% PROCESS "bug/process/bugmail.html.tmpl" mailing_bugid = attachment.bug_id %]
+ [%# Links to more information about the changed bug. %]
+ [% Hook.process("links") %]
+ </dd>
+</dl>
+
+[% PROCESS bug/show.html.tmpl %]