From 06e65cf6b9bd32a7a938f2f3f074a732e200c3f0 Mon Sep 17 00:00:00 2001 From: "kiko%async.com.br" Date: Tue, 16 Mar 2004 23:53:01 +0000 Subject: [PATCH] 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 to use new classes and clean up callsites. Patch by byron jones . r=myk, gerv. a=myk. --- webtools/bugzilla/Bugzilla/Template.pm | 31 +++++++++++++++++-- webtools/bugzilla/checksetup.pl | 4 ++- webtools/bugzilla/css/edit_bug.css | 4 ++- webtools/bugzilla/editusers.cgi | 4 +-- webtools/bugzilla/globals.pl | 4 +-- webtools/bugzilla/t/004template.t | 4 ++- .../en/default/attachment/list.html.tmpl | 2 +- .../attachment/show-multiple.html.tmpl | 6 +--- .../en/default/bug/dependency-tree.html.tmpl | 6 ++-- .../default/bug/votes/list-for-user.html.tmpl | 5 ++- .../template/en/default/filterexceptions.pl | 2 +- .../en/default/list/edit-multiple.html.tmpl | 6 ++-- .../reports/duplicates-table.html.tmpl | 5 ++- 13 files changed, 55 insertions(+), 28 deletions(-) diff --git a/webtools/bugzilla/Bugzilla/Template.pm b/webtools/bugzilla/Bugzilla/Template.pm index 310a181611cc..cb6b54c90664 100644 --- a/webtools/bugzilla/Bugzilla/Template.pm +++ b/webtools/bugzilla/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 "" . $_[0] . "" }, + + # Render text in required style. + + inactive => [ + sub { + my($context, $isinactive) = @_; + return sub { + return $isinactive ? ''.$_[0].'' : $_[0]; + } + }, 1 + ], + + closed => [ + sub { + my($context, $isclosed) = @_; + return sub { + return $isclosed ? ''.$_[0].'' : $_[0]; + } + }, 1 + ], + + obsolete => [ + sub { + my($context, $isobsolete) = @_; + return sub { + return $isobsolete ? ''.$_[0].'' : $_[0]; + } + }, 1 + ], # Returns the text with backslashes, single/double quotes, # and newlines/carriage returns escaped for use in JS strings. diff --git a/webtools/bugzilla/checksetup.pl b/webtools/bugzilla/checksetup.pl index 00114ecc14e2..c14339f9a2a4 100755 --- a/webtools/bugzilla/checksetup.pl +++ b/webtools/bugzilla/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/webtools/bugzilla/css/edit_bug.css b/webtools/bugzilla/css/edit_bug.css index d5576f39130d..edde85685904 100644 --- a/webtools/bugzilla/css/edit_bug.css +++ b/webtools/bugzilla/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/webtools/bugzilla/editusers.cgi b/webtools/bugzilla/editusers.cgi index e1a6940ce045..32a7b06f3430 100755 --- a/webtools/bugzilla/editusers.cgi +++ b/webtools/bugzilla/editusers.cgi @@ -351,8 +351,8 @@ if ($action eq 'list') { my $s = ""; my $e = ""; if ($disabledtext) { - $s = ""; - $e = ""; + $s = ''; + $e = ''; } $realname = ($realname ? html_quote($realname) : "missing"); print "\n"; diff --git a/webtools/bugzilla/globals.pl b/webtools/bugzilla/globals.pl index 91fd0555456e..cdb61cd66bb2 100644 --- a/webtools/bugzilla/globals.pl +++ b/webtools/bugzilla/globals.pl @@ -1034,9 +1034,9 @@ sub GetBugLink { $post = ""; } elsif (! IsOpenedState($bug_state)) { - $pre = ""; + $pre = ''; $title .= " $bug_res"; - $post = ""; + $post = ''; } if (CanSeeBug($bug_num, $::userid)) { $title .= " - $bug_desc"; diff --git a/webtools/bugzilla/t/004template.t b/webtools/bugzilla/t/004template.t index 6c753c0bd793..660ee5c65453 100644 --- a/webtools/bugzilla/t/004template.t +++ b/webtools/bugzilla/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/webtools/bugzilla/template/en/default/attachment/list.html.tmpl b/webtools/bugzilla/template/en/default/attachment/list.html.tmpl index 1ef6cab12c91..8558a5959e96 100644 --- a/webtools/bugzilla/template/en/default/attachment/list.html.tmpl +++ b/webtools/bugzilla/template/en/default/attachment/list.html.tmpl @@ -36,7 +36,7 @@ [% IF !attachment.isprivate || canseeprivate %] - [% attachment.description FILTER html %] + [% attachment.description FILTER html FILTER obsolete(attachment.isobsolete) %] diff --git a/webtools/bugzilla/template/en/default/attachment/show-multiple.html.tmpl b/webtools/bugzilla/template/en/default/attachment/show-multiple.html.tmpl index 48f03dff133e..bcfae488ddde 100644 --- a/webtools/bugzilla/template/en/default/attachment/show-multiple.html.tmpl +++ b/webtools/bugzilla/template/en/default/attachment/show-multiple.html.tmpl @@ -46,11 +46,7 @@ - [% IF a.isobsolete %] - [% a.description FILTER html %] - [% ELSE %] - [% a.description FILTER html %] - [% END %] + [% a.description FILTER html FILTER obsolete(a.isobsolete) %] diff --git a/webtools/bugzilla/template/en/default/bug/dependency-tree.html.tmpl b/webtools/bugzilla/template/en/default/bug/dependency-tree.html.tmpl index b0da74a1745e..a5bdcce276ec 100644 --- a/webtools/bugzilla/template/en/default/bug/dependency-tree.html.tmpl +++ b/webtools/bugzilla/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 $terms.Bug $bugid" - style = "strike { background-color: #d9d9d9; color: #000000; }" %] [% PROCESS depthControlToolbar %] @@ -92,7 +91,8 @@
  • [% "" IF dep.dependencies.size > 0 && !dep.seen %] - [% "" IF !dep.open %] + [% isclosed = !dep.open %] + [% FILTER closed(isclosed) %] [% dep_id %] [[% IF dep.milestone %][% dep.milestone FILTER html %], [% END %] [% dep.assignee_email FILTER html %]] - @@ -101,7 +101,7 @@ [% ELSE %] [% dep.summary FILTER html %]. [% END %] - [% "" IF !dep.open %] + [% END %] [% INCLUDE display_tree bug_id=dep_id IF dep.dependencies.size > 0 && !dep.seen %]
  • diff --git a/webtools/bugzilla/template/en/default/bug/votes/list-for-user.html.tmpl b/webtools/bugzilla/template/en/default/bug/votes/list-for-user.html.tmpl index d7214349c204..27551f19d2b5 100644 --- a/webtools/bugzilla/template/en/default/bug/votes/list-for-user.html.tmpl +++ b/webtools/bugzilla/template/en/default/bug/votes/list-for-user.html.tmpl @@ -89,10 +89,9 @@ [% END %] - [% "" IF NOT bug.opened %] + [% isclosed = !bug.opened %] - [% bug.id %] - [% "" IF NOT bug.opened %] + [% bug.id FILTER closed(isclosed) %] diff --git a/webtools/bugzilla/template/en/default/filterexceptions.pl b/webtools/bugzilla/template/en/default/filterexceptions.pl index 05b52c5b80cb..1c74c3b899ae 100644 --- a/webtools/bugzilla/template/en/default/filterexceptions.pl +++ b/webtools/bugzilla/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/webtools/bugzilla/template/en/default/list/edit-multiple.html.tmpl b/webtools/bugzilla/template/en/default/list/edit-multiple.html.tmpl index 1d758e58e907..d3c23ce66b2e 100644 --- a/webtools/bugzilla/template/en/default/list/edit-multiple.html.tmpl +++ b/webtools/bugzilla/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 %] @@ -229,8 +229,8 @@ [% IF foundinactive %] - (Note: [% terms.Bugs %] may not be added to inactive - groups, only removed.)
    + (Note: [% terms.Bugs %] may not be added to [% FILTER inactive %]inactive + groups[% END %], only removed.)
    [% END %] [% END %] diff --git a/webtools/bugzilla/template/en/default/reports/duplicates-table.html.tmpl b/webtools/bugzilla/template/en/default/reports/duplicates-table.html.tmpl index f8ea3a457b9c..6017a1e4e2c0 100644 --- a/webtools/bugzilla/template/en/default/reports/duplicates-table.html.tmpl +++ b/webtools/bugzilla/template/en/default/reports/duplicates-table.html.tmpl @@ -120,9 +120,8 @@
    - [% "" IF bug.resolution != "" %] - [% bug.id %] - [% "" IF bug.resolution != "" %] + [% isclosed = bug.resolution != "" %] + [% bug.id FILTER closed(isclosed) %]