summaryrefslogtreecommitdiffstats
path: root/template
diff options
context:
space:
mode:
authorjkeiser%netscape.com <>2003-08-20 09:45:39 +0200
committerjkeiser%netscape.com <>2003-08-20 09:45:39 +0200
commitd08d7d95cfb5813b08f4c0bbc50cc435f6cf275c (patch)
tree3cb6ca922ed6198377ce111ea7d0ff0ec4156214 /template
parent3efe1a905d11fe607e1a2e15989ff5ba001f757b (diff)
downloadbugzilla-d08d7d95cfb5813b08f4c0bbc50cc435f6cf275c.tar.gz
bugzilla-d08d7d95cfb5813b08f4c0bbc50cc435f6cf275c.tar.xz
Check for PatchReader as a part of the installation and disable the "Diff"
links if it is not there (bug 215268)
Diffstat (limited to 'template')
-rw-r--r--template/en/default/attachment/edit.html.tmpl16
-rw-r--r--template/en/default/attachment/list.html.tmpl2
2 files changed, 16 insertions, 2 deletions
diff --git a/template/en/default/attachment/edit.html.tmpl b/template/en/default/attachment/edit.html.tmpl
index 2cfc0e088..3de65766a 100644
--- a/template/en/default/attachment/edit.html.tmpl
+++ b/template/en/default/attachment/edit.html.tmpl
@@ -90,6 +90,7 @@
{
switchToMode('edit');
}
+[% IF patchviewerinstalled %]
function viewDiff()
{
switchToMode('diff');
@@ -102,6 +103,7 @@
has_viewed_as_diff = 1;
}
}
+[% END %]
function viewRaw()
{
switchToMode('raw');
@@ -120,11 +122,15 @@
hideElementById('undoEditButton');
} else if (current_mode == 'raw') {
hideElementById('viewFrame');
+[% IF patchviewerinstalled %]
hideElementById('viewDiffButton');
+[% END %]
hideElementById(has_edited ? 'redoEditButton' : 'editButton');
hideElementById('smallCommentFrame');
} else if (current_mode == 'diff') {
+[% IF patchviewerinstalled %]
hideElementById('viewDiffFrame');
+[% END %]
hideElementById('viewRawButton');
hideElementById(has_edited ? 'redoEditButton' : 'editButton');
hideElementById('smallCommentFrame');
@@ -136,11 +142,15 @@
showElementById('undoEditButton');
} else if (mode == 'raw') {
showElementById('viewFrame');
+[% IF patchviewerinstalled %]
showElementById('viewDiffButton');
+[% END %]
showElementById(has_edited ? 'redoEditButton' : 'editButton');
showElementById('smallCommentFrame');
} else if (mode == 'diff') {
+[% IF patchviewerinstalled %]
showElementById('viewDiffFrame');
+[% END %]
showElementById('viewRawButton');
showElementById(has_edited ? 'redoEditButton' : 'editButton');
showElementById('smallCommentFrame');
@@ -227,7 +237,7 @@
<input type="submit" value="Submit"><br><br>
<strong>Actions:</strong> <a href="attachment.cgi?id=[% attachid %]">View</a>
- [% IF ispatch %]
+ [% IF ispatch && patchviewerinstalled %]
| <a href="attachment.cgi?id=[% attachid %]&action=diff">Diff</a>
[% END %]
</small>
@@ -243,11 +253,15 @@
<script type="application/x-javascript" language="JavaScript">
<!--
if (typeof document.getElementById == "function") {
+[% IF patchviewerinstalled %]
document.write('<iframe id="viewDiffFrame" style="height: 400px; width: 100%; display: none;"></iframe>');
+[% END %]
document.write('<button type="button" id="editButton" onclick="editAsComment();">Edit Attachment As Comment</button>');
document.write('<button type="button" id="undoEditButton" onclick="undoEditAsComment();" style="display: none;">Undo Edit As Comment</button>');
document.write('<button type="button" id="redoEditButton" onclick="redoEditAsComment();" style="display: none;">Redo Edit As Comment</button>');
+[% IF patchviewerinstalled %]
document.write('<button type="button" id="viewDiffButton" onclick="viewDiff();">View Attachment As Diff</button>');
+[% END %]
document.write('<button type="button" id="viewRawButton" onclick="viewRaw();" style="display: none;">View Attachment As Raw</button>');
}
//-->
diff --git a/template/en/default/attachment/list.html.tmpl b/template/en/default/attachment/list.html.tmpl
index 598f8172b..163071997 100644
--- a/template/en/default/attachment/list.html.tmpl
+++ b/template/en/default/attachment/list.html.tmpl
@@ -70,7 +70,7 @@
[% IF attachment.canedit %]
<a href="attachment.cgi?id=[% attachment.attachid %]&amp;action=edit">Edit</a>
[% END %]
- [% IF attachment.ispatch %]
+ [% IF attachment.ispatch && patchviewerinstalled %]
[% IF attachment.canedit %]
|
[% END %]