Commit 380b6e52 authored by kiko%async.com.br's avatar kiko%async.com.br

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.
parent 1bcd4b67
...@@ -195,8 +195,35 @@ sub create { ...@@ -195,8 +195,35 @@ sub create {
# built-in filter, please also add a stub filter to checksetup.pl # built-in filter, please also add a stub filter to checksetup.pl
# and t/004template.t. # and t/004template.t.
FILTERS => { 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, # Returns the text with backslashes, single/double quotes,
# and newlines/carriage returns escaped for use in JS strings. # and newlines/carriage returns escaped for use in JS strings.
......
...@@ -1178,7 +1178,9 @@ END ...@@ -1178,7 +1178,9 @@ END
# These don't actually need to do anything here, just exist # These don't actually need to do anything here, just exist
FILTERS => FILTERS =>
{ {
strike => sub { return $_; } , inactive => sub { return $_; } ,
closed => sub { return $_; },
obsolete => sub { return $_; },
js => sub { return $_; }, js => sub { return $_; },
html_linebreak => sub { return $_; }, html_linebreak => sub { return $_; },
url_quote => sub { return $_; }, url_quote => sub { return $_; },
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
.bz_private { color: darkred ; background : #f3eeee ; } .bz_private { color: darkred ; background : #f3eeee ; }
.bz_disabled { color: #a0a0a0 ; } .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; } table#flags th, table#flags td { vertical-align: baseline; text-align: left; }
...@@ -351,8 +351,8 @@ if ($action eq 'list') { ...@@ -351,8 +351,8 @@ if ($action eq 'list') {
my $s = ""; my $s = "";
my $e = ""; my $e = "";
if ($disabledtext) { if ($disabledtext) {
$s = "<STRIKE>"; $s = '<span class="bz_inactive">';
$e = "</STRIKE>"; $e = '</span>';
} }
$realname = ($realname ? html_quote($realname) : "<FONT COLOR=\"red\">missing</FONT>"); $realname = ($realname ? html_quote($realname) : "<FONT COLOR=\"red\">missing</FONT>");
print "<TR>\n"; print "<TR>\n";
......
...@@ -1034,9 +1034,9 @@ sub GetBugLink { ...@@ -1034,9 +1034,9 @@ sub GetBugLink {
$post = "</i>"; $post = "</i>";
} }
elsif (! IsOpenedState($bug_state)) { elsif (! IsOpenedState($bug_state)) {
$pre = "<strike>"; $pre = '<span class="bz_closed">';
$title .= " $bug_res"; $title .= " $bug_res";
$post = "</strike>"; $post = '</span>';
} }
if (CanSeeBug($bug_num, $::userid)) { if (CanSeeBug($bug_num, $::userid)) {
$title .= " - $bug_desc"; $title .= " - $bug_desc";
......
...@@ -94,7 +94,9 @@ foreach my $include_path (@include_paths) { ...@@ -94,7 +94,9 @@ foreach my $include_path (@include_paths) {
{ {
html_linebreak => sub { return $_; }, html_linebreak => sub { return $_; },
js => sub { return $_ } , js => sub { return $_ } ,
strike => sub { return $_ } , inactive => sub { return $_; } ,
closed => sub { return $_; },
obsolete => sub { return $_; },
url_quote => sub { return $_ } , url_quote => sub { return $_ } ,
css_class_quote => sub { return $_ } , css_class_quote => sub { return $_ } ,
xml => sub { return $_ } , xml => sub { return $_ } ,
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
[% IF !attachment.isprivate || canseeprivate %] [% IF !attachment.isprivate || canseeprivate %]
<tr [% "class=\"bz_private\"" IF attachment.isprivate %]> <tr [% "class=\"bz_private\"" IF attachment.isprivate %]>
<td valign="top"> <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>
<td valign="top"> <td valign="top">
......
...@@ -46,11 +46,7 @@ ...@@ -46,11 +46,7 @@
</tr> </tr>
<tr> <tr>
<td valign="top"> <td valign="top">
[% IF a.isobsolete %] [% a.description FILTER html FILTER obsolete(a.isobsolete) %]
<strike>[% a.description FILTER html %]</strike>
[% ELSE %]
[% a.description FILTER html %]
[% END %]
</td> </td>
<td valign="top"> <td valign="top">
......
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
[% PROCESS global/header.html.tmpl [% PROCESS global/header.html.tmpl
title = "Dependency tree for $terms.Bug $bugid" title = "Dependency tree for $terms.Bug $bugid"
h1 = "Dependency tree for <a href=\"show_bug.cgi?id=$bugid\">$terms.Bug $bugid</a>" h1 = "Dependency tree for <a href=\"show_bug.cgi?id=$bugid\">$terms.Bug $bugid</a>"
style = "strike { background-color: #d9d9d9; color: #000000; }"
%] %]
[% PROCESS depthControlToolbar %] [% PROCESS depthControlToolbar %]
...@@ -92,7 +91,8 @@ ...@@ -92,7 +91,8 @@
<li> <li>
[% "<script>document.write('<a href=\"#\" class=\"toggle\" onclick=\"listToggle(event); return false\">[-]</a>')</script>" [% "<script>document.write('<a href=\"#\" class=\"toggle\" onclick=\"listToggle(event); return false\">[-]</a>')</script>"
IF dep.dependencies.size > 0 && !dep.seen %] 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 %] <a href="show_bug.cgi?id=[% dep_id %]">[% dep_id %]
[[% IF dep.milestone %][% dep.milestone FILTER html %], [% END %] [[% IF dep.milestone %][% dep.milestone FILTER html %], [% END %]
[% dep.assignee_email FILTER html %]] - [% dep.assignee_email FILTER html %]] -
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
[% ELSE %] [% ELSE %]
[% dep.summary FILTER html %].</a> [% dep.summary FILTER html %].</a>
[% END %] [% END %]
[% "</strike>" IF !dep.open %] [% END %]
[% INCLUDE display_tree bug_id=dep_id [% INCLUDE display_tree bug_id=dep_id
IF dep.dependencies.size > 0 && !dep.seen %] IF dep.dependencies.size > 0 && !dep.seen %]
</li> </li>
......
...@@ -89,10 +89,9 @@ ...@@ -89,10 +89,9 @@
[% END %] [% END %]
</td> </td>
<td align="right"> <td align="right">
[% "<strike>" IF NOT bug.opened %] [% isclosed = !bug.opened %]
<a href="show_bug.cgi?id=[% bug.id %]"> <a href="show_bug.cgi?id=[% bug.id %]">
[% bug.id %]</a> [% bug.id FILTER closed(isclosed) %]</a>
[% "</strike>" IF NOT bug.opened %]
</td> </td>
<td> <td>
<a href="votes.cgi?action=show_bug&amp;bug_id=[% bug.id %]"> <a href="votes.cgi?action=show_bug&amp;bug_id=[% bug.id %]">
......
...@@ -197,7 +197,7 @@ ...@@ -197,7 +197,7 @@
'list/edit-multiple.html.tmpl' => [ 'list/edit-multiple.html.tmpl' => [
'group.id', 'group.id',
'group.description', 'group.description',
'group.description FILTER strike', 'group.description FILTER inactive',
'knum', 'knum',
'menuname', 'menuname',
], ],
......
...@@ -219,7 +219,7 @@ ...@@ -219,7 +219,7 @@
[% IF group.isactive %] [% IF group.isactive %]
[% group.description %] [% group.description %]
[% ELSE %] [% ELSE %]
[% group.description FILTER strike %] [% group.description FILTER inactive %]
[% END %] [% END %]
</td> </td>
...@@ -229,8 +229,8 @@ ...@@ -229,8 +229,8 @@
</table> </table>
[% IF foundinactive %] [% IF foundinactive %]
<font size="-1">(Note: [% terms.Bugs %] may not be added to <strike>inactive <font size="-1">(Note: [% terms.Bugs %] may not be added to [% FILTER inactive %]inactive
groups</strike>, only removed.)</font><br> groups[% END %], only removed.)</font><br>
[% END %] [% END %]
[% END %] [% END %]
......
...@@ -120,9 +120,8 @@ ...@@ -120,9 +120,8 @@
<tr [% "class='resolved'" IF bug.resolution != "" %]> <tr [% "class='resolved'" IF bug.resolution != "" %]>
<td> <td>
<center> <center>
[% "<strike>" IF bug.resolution != "" %] [% isclosed = bug.resolution != "" %]
<a href="show_bug.cgi?id=[% bug.id %]">[% bug.id %]</a> <a href="show_bug.cgi?id=[% bug.id %]">[% bug.id FILTER closed(isclosed) %]</a>
[% "</strike>" IF bug.resolution != "" %]
</center> </center>
</td> </td>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment