summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkiko%async.com.br <>2004-03-17 08:52:47 +0100
committerkiko%async.com.br <>2004-03-17 08:52:47 +0100
commit380b6e527cfb9cc98e6e40849915e2627fa2d0ae (patch)
treee104366c8bfcbfe674c37de32cce1fd2dc00f4c9
parent1bcd4b67a3ea4468ce3127ca1e9cce4a59690824 (diff)
downloadbugzilla-380b6e527cfb9cc98e6e40849915e2627fa2d0ae.tar.gz
bugzilla-380b6e527cfb9cc98e6e40849915e2627fa2d0ae.tar.xz
Fix for bug 232397: .bz_obsolete shouldn't specify "underline". Define
specific bz_obsolete/closed/inactive classes (that don't specify underline, but line-through instead) and additional Template filters for conveniently applying them. Change occurences of <strike> to use new classes and clean up callsites. Patch by byron jones <bugzilla@glob.com.au>. r=myk, gerv. a=myk.
-rw-r--r--Bugzilla/Template.pm31
-rwxr-xr-xchecksetup.pl4
-rw-r--r--css/edit_bug.css4
-rwxr-xr-xeditusers.cgi4
-rw-r--r--globals.pl4
-rw-r--r--t/004template.t4
-rw-r--r--template/en/default/attachment/list.html.tmpl2
-rw-r--r--template/en/default/attachment/show-multiple.html.tmpl6
-rw-r--r--template/en/default/bug/dependency-tree.html.tmpl6
-rw-r--r--template/en/default/bug/votes/list-for-user.html.tmpl5
-rw-r--r--template/en/default/filterexceptions.pl2
-rw-r--r--template/en/default/list/edit-multiple.html.tmpl6
-rw-r--r--template/en/default/reports/duplicates-table.html.tmpl5
13 files changed, 55 insertions, 28 deletions
diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm
index 310a18161..cb6b54c90 100644
--- a/Bugzilla/Template.pm
+++ b/Bugzilla/Template.pm
@@ -195,8 +195,35 @@ sub create {
# built-in filter, please also add a stub filter to checksetup.pl
# and t/004template.t.
FILTERS => {
- # Render text in strike-through style.
- strike => sub { return "<strike>" . $_[0] . "</strike>" },
+
+ # Render text in required style.
+
+ inactive => [
+ sub {
+ my($context, $isinactive) = @_;
+ return sub {
+ return $isinactive ? '<span class="bz_inactive">'.$_[0].'</span>' : $_[0];
+ }
+ }, 1
+ ],
+
+ closed => [
+ sub {
+ my($context, $isclosed) = @_;
+ return sub {
+ return $isclosed ? '<span class="bz_closed">'.$_[0].'</span>' : $_[0];
+ }
+ }, 1
+ ],
+
+ obsolete => [
+ sub {
+ my($context, $isobsolete) = @_;
+ return sub {
+ return $isobsolete ? '<span class="bz_obsolete">'.$_[0].'</span>' : $_[0];
+ }
+ }, 1
+ ],
# Returns the text with backslashes, single/double quotes,
# and newlines/carriage returns escaped for use in JS strings.
diff --git a/checksetup.pl b/checksetup.pl
index 00114ecc1..c14339f9a 100755
--- a/checksetup.pl
+++ b/checksetup.pl
@@ -1178,7 +1178,9 @@ END
# These don't actually need to do anything here, just exist
FILTERS =>
{
- strike => sub { return $_; } ,
+ inactive => sub { return $_; } ,
+ closed => sub { return $_; },
+ obsolete => sub { return $_; },
js => sub { return $_; },
html_linebreak => sub { return $_; },
url_quote => sub { return $_; },
diff --git a/css/edit_bug.css b/css/edit_bug.css
index d5576f391..edde85685 100644
--- a/css/edit_bug.css
+++ b/css/edit_bug.css
@@ -2,6 +2,8 @@
.bz_private { color: darkred ; background : #f3eeee ; }
.bz_disabled { color: #a0a0a0 ; }
-.bz_obsolete { text-decoration: line-through underline; }
+.bz_obsolete { text-decoration: line-through; }
+.bz_inactive { text-decoration: line-through; }
+.bz_closed { text-decoration: line-through; }
table#flags th, table#flags td { vertical-align: baseline; text-align: left; }
diff --git a/editusers.cgi b/editusers.cgi
index e1a6940ce..32a7b06f3 100755
--- a/editusers.cgi
+++ b/editusers.cgi
@@ -351,8 +351,8 @@ if ($action eq 'list') {
my $s = "";
my $e = "";
if ($disabledtext) {
- $s = "<STRIKE>";
- $e = "</STRIKE>";
+ $s = '<span class="bz_inactive">';
+ $e = '</span>';
}
$realname = ($realname ? html_quote($realname) : "<FONT COLOR=\"red\">missing</FONT>");
print "<TR>\n";
diff --git a/globals.pl b/globals.pl
index 91fd05554..cdb61cd66 100644
--- a/globals.pl
+++ b/globals.pl
@@ -1034,9 +1034,9 @@ sub GetBugLink {
$post = "</i>";
}
elsif (! IsOpenedState($bug_state)) {
- $pre = "<strike>";
+ $pre = '<span class="bz_closed">';
$title .= " $bug_res";
- $post = "</strike>";
+ $post = '</span>';
}
if (CanSeeBug($bug_num, $::userid)) {
$title .= " - $bug_desc";
diff --git a/t/004template.t b/t/004template.t
index 6c753c0bd..660ee5c65 100644
--- a/t/004template.t
+++ b/t/004template.t
@@ -94,7 +94,9 @@ foreach my $include_path (@include_paths) {
{
html_linebreak => sub { return $_; },
js => sub { return $_ } ,
- strike => sub { return $_ } ,
+ inactive => sub { return $_; } ,
+ closed => sub { return $_; },
+ obsolete => sub { return $_; },
url_quote => sub { return $_ } ,
css_class_quote => sub { return $_ } ,
xml => sub { return $_ } ,
diff --git a/template/en/default/attachment/list.html.tmpl b/template/en/default/attachment/list.html.tmpl
index 1ef6cab12..8558a5959 100644
--- a/template/en/default/attachment/list.html.tmpl
+++ b/template/en/default/attachment/list.html.tmpl
@@ -36,7 +36,7 @@
[% IF !attachment.isprivate || canseeprivate %]
<tr [% "class=\"bz_private\"" IF attachment.isprivate %]>
<td valign="top">
- <a href="attachment.cgi?id=[% attachment.attachid %]&amp;action=view" [% "class=\"bz_obsolete\"" IF attachment.isobsolete %]>[% attachment.description FILTER html %]</a>
+ <a href="attachment.cgi?id=[% attachment.attachid %]&amp;action=view">[% attachment.description FILTER html FILTER obsolete(attachment.isobsolete) %]</a>
</td>
<td valign="top">
diff --git a/template/en/default/attachment/show-multiple.html.tmpl b/template/en/default/attachment/show-multiple.html.tmpl
index 48f03dff1..bcfae488d 100644
--- a/template/en/default/attachment/show-multiple.html.tmpl
+++ b/template/en/default/attachment/show-multiple.html.tmpl
@@ -46,11 +46,7 @@
</tr>
<tr>
<td valign="top">
- [% IF a.isobsolete %]
- <strike>[% a.description FILTER html %]</strike>
- [% ELSE %]
- [% a.description FILTER html %]
- [% END %]
+ [% a.description FILTER html FILTER obsolete(a.isobsolete) %]
</td>
<td valign="top">
diff --git a/template/en/default/bug/dependency-tree.html.tmpl b/template/en/default/bug/dependency-tree.html.tmpl
index b0da74a17..a5bdcce27 100644
--- a/template/en/default/bug/dependency-tree.html.tmpl
+++ b/template/en/default/bug/dependency-tree.html.tmpl
@@ -26,7 +26,6 @@
[% PROCESS global/header.html.tmpl
title = "Dependency tree for $terms.Bug $bugid"
h1 = "Dependency tree for <a href=\"show_bug.cgi?id=$bugid\">$terms.Bug $bugid</a>"
- style = "strike { background-color: #d9d9d9; color: #000000; }"
%]
[% PROCESS depthControlToolbar %]
@@ -92,7 +91,8 @@
<li>
[% "<script>document.write('<a href=\"#\" class=\"toggle\" onclick=\"listToggle(event); return false\">[-]</a>')</script>"
IF dep.dependencies.size > 0 && !dep.seen %]
- [% "<strike>" IF !dep.open %]
+ [% isclosed = !dep.open %]
+ [% FILTER closed(isclosed) %]
<a href="show_bug.cgi?id=[% dep_id %]">[% dep_id %]
[[% IF dep.milestone %][% dep.milestone FILTER html %], [% END %]
[% dep.assignee_email FILTER html %]] -
@@ -101,7 +101,7 @@
[% ELSE %]
[% dep.summary FILTER html %].</a>
[% END %]
- [% "</strike>" IF !dep.open %]
+ [% END %]
[% INCLUDE display_tree bug_id=dep_id
IF dep.dependencies.size > 0 && !dep.seen %]
</li>
diff --git a/template/en/default/bug/votes/list-for-user.html.tmpl b/template/en/default/bug/votes/list-for-user.html.tmpl
index d7214349c..27551f19d 100644
--- a/template/en/default/bug/votes/list-for-user.html.tmpl
+++ b/template/en/default/bug/votes/list-for-user.html.tmpl
@@ -89,10 +89,9 @@
[% END %]
</td>
<td align="right">
- [% "<strike>" IF NOT bug.opened %]
+ [% isclosed = !bug.opened %]
<a href="show_bug.cgi?id=[% bug.id %]">
- [% bug.id %]</a>
- [% "</strike>" IF NOT bug.opened %]
+ [% bug.id FILTER closed(isclosed) %]</a>
</td>
<td>
<a href="votes.cgi?action=show_bug&amp;bug_id=[% bug.id %]">
diff --git a/template/en/default/filterexceptions.pl b/template/en/default/filterexceptions.pl
index 05b52c5b8..1c74c3b89 100644
--- a/template/en/default/filterexceptions.pl
+++ b/template/en/default/filterexceptions.pl
@@ -197,7 +197,7 @@
'list/edit-multiple.html.tmpl' => [
'group.id',
'group.description',
- 'group.description FILTER strike',
+ 'group.description FILTER inactive',
'knum',
'menuname',
],
diff --git a/template/en/default/list/edit-multiple.html.tmpl b/template/en/default/list/edit-multiple.html.tmpl
index 1d758e58e..d3c23ce66 100644
--- a/template/en/default/list/edit-multiple.html.tmpl
+++ b/template/en/default/list/edit-multiple.html.tmpl
@@ -219,7 +219,7 @@
[% IF group.isactive %]
[% group.description %]
[% ELSE %]
- [% group.description FILTER strike %]
+ [% group.description FILTER inactive %]
[% END %]
</td>
@@ -229,8 +229,8 @@
</table>
[% IF foundinactive %]
- <font size="-1">(Note: [% terms.Bugs %] may not be added to <strike>inactive
- groups</strike>, only removed.)</font><br>
+ <font size="-1">(Note: [% terms.Bugs %] may not be added to [% FILTER inactive %]inactive
+ groups[% END %], only removed.)</font><br>
[% END %]
[% END %]
diff --git a/template/en/default/reports/duplicates-table.html.tmpl b/template/en/default/reports/duplicates-table.html.tmpl
index f8ea3a457..6017a1e4e 100644
--- a/template/en/default/reports/duplicates-table.html.tmpl
+++ b/template/en/default/reports/duplicates-table.html.tmpl
@@ -120,9 +120,8 @@
<tr [% "class='resolved'" IF bug.resolution != "" %]>
<td>
<center>
- [% "<strike>" IF bug.resolution != "" %]
- <a href="show_bug.cgi?id=[% bug.id %]">[% bug.id %]</a>
- [% "</strike>" IF bug.resolution != "" %]
+ [% isclosed = bug.resolution != "" %]
+ <a href="show_bug.cgi?id=[% bug.id %]">[% bug.id FILTER closed(isclosed) %]</a>
</center>
</td>