summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Template.pm
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 /Bugzilla/Template.pm
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.
Diffstat (limited to 'Bugzilla/Template.pm')
-rw-r--r--Bugzilla/Template.pm31
1 files changed, 29 insertions, 2 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.