summaryrefslogtreecommitdiffstats
path: root/template/en
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2009-10-01 00:39:28 +0200
committermkanat%bugzilla.org <>2009-10-01 00:39:28 +0200
commit58787923c838e5a1fc90d3f98e27a443bb1e1122 (patch)
tree52c55649b3d9283985a5612393ad1a9276435f94 /template/en
parent832be61ce419f06cc682e7afc07d9197592a6bf5 (diff)
downloadbugzilla-58787923c838e5a1fc90d3f98e27a443bb1e1122.tar.gz
bugzilla-58787923c838e5a1fc90d3f98e27a443bb1e1122.tar.xz
Bug 509053: Implement Bugzilla->feature (feature_enabled in the templates), and use it to detect when PatchReader is available.
Patch by Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=LpSolit
Diffstat (limited to 'template/en')
-rw-r--r--template/en/default/attachment/edit.html.tmpl8
-rw-r--r--template/en/default/attachment/list.html.tmpl2
-rw-r--r--template/en/default/global/code-error.html.tmpl6
3 files changed, 11 insertions, 5 deletions
diff --git a/template/en/default/attachment/edit.html.tmpl b/template/en/default/attachment/edit.html.tmpl
index fadf3e308..bbdf24866 100644
--- a/template/en/default/attachment/edit.html.tmpl
+++ b/template/en/default/attachment/edit.html.tmpl
@@ -40,7 +40,7 @@
%]
[%# No need to display the Diff button and iframe if the attachment is not a patch. %]
-[% patchviewerinstalled = (patchviewerinstalled && attachment.ispatch) %]
+[% use_patchviewer = (feature_enabled('patch_viewer') && attachment.ispatch) %]
<form method="post" action="attachment.cgi" onsubmit="normalizeComments();">
<input type="hidden" name="id" value="[% attachment.id %]">
@@ -127,7 +127,7 @@
<input type="submit" value="Submit" id="update"><br><br>
<strong>Actions:</strong>
<a href="attachment.cgi?id=[% attachment.id %]">View</a>
- [% IF attachment.ispatch && patchviewerinstalled %]
+ [% IF use_patchviewer %]
| <a href="attachment.cgi?id=[% attachment.id %]&amp;action=diff">Diff</a>
[% END %]
[% IF Param("allow_attachment_deletion")
@@ -183,14 +183,14 @@
var patchviewerinstalled = 0;
var attachment_id = [% attachment.id %];
if (typeof document.getElementById == "function") {
-[% IF patchviewerinstalled %]
+[% IF use_patchviewer %]
var patchviewerinstalled = 1;
document.write('<iframe id="viewDiffFrame" style="height: 400px; width: 100%; display: none;"><\/iframe>');
[% END %]
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);" style="display: none;">Undo Edit As Comment<\/button>');
document.write('<button type="button" id="redoEditButton" onclick="redoEditAsComment(patchviewerinstalled);" style="display: none;">Redo Edit As Comment<\/button>');
-[% IF patchviewerinstalled %]
+[% 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);" 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 04894ff8d..bd597e48b 100644
--- a/template/en/default/attachment/list.html.tmpl
+++ b/template/en/default/attachment/list.html.tmpl
@@ -117,7 +117,7 @@ function toggle_display(link) {
<td valign="top">
<a href="attachment.cgi?id=[% attachment.id %]&amp;action=edit">Details</a>
- [% IF attachment.ispatch && patchviewerinstalled %]
+ [% IF attachment.ispatch && feature_enabled('patch_viewer') %]
| <a href="attachment.cgi?id=[% attachment.id %]&amp;action=diff">Diff</a>
[% END %]
[% Hook.process("action") %]
diff --git a/template/en/default/global/code-error.html.tmpl b/template/en/default/global/code-error.html.tmpl
index d75ca4432..8ad0c4ae9 100644
--- a/template/en/default/global/code-error.html.tmpl
+++ b/template/en/default/global/code-error.html.tmpl
@@ -198,6 +198,12 @@
[% title = "Invalid Dimensions" %]
The width or height specified is not a positive integer.
+ [% ELSIF error == "invalid_feature" %]
+ [% title = "Invalid Feature Name" %]
+ [% feature FILTER html %] is not a valid feature name. See
+ <code>OPTIONAL_MODULES</code> in
+ <code>Bugzilla::Install::Requirements</code> for valid names.
+
[% ELSIF error == "invalid_flag_association" %]
[% title = "Invalid Flag Association" %]
Some flags do not belong to