]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Fix for bug 232397: .bz_obsolete shouldn't specify "underline". Define
authorkiko%async.com.br <>
Wed, 17 Mar 2004 07:52:47 +0000 (07:52 +0000)
committerkiko%async.com.br <>
Wed, 17 Mar 2004 07:52:47 +0000 (07:52 +0000)
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.

13 files changed:
Bugzilla/Template.pm
checksetup.pl
css/edit_bug.css
editusers.cgi
globals.pl
t/004template.t
template/en/default/attachment/list.html.tmpl
template/en/default/attachment/show-multiple.html.tmpl
template/en/default/bug/dependency-tree.html.tmpl
template/en/default/bug/votes/list-for-user.html.tmpl
template/en/default/filterexceptions.pl
template/en/default/list/edit-multiple.html.tmpl
template/en/default/reports/duplicates-table.html.tmpl

index 310a181611ccfd8da02b5cfb46c674154418f10e..cb6b54c906643024f13107621327577168e64850 100644 (file)
@@ -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.
index 00114ecc14e21209c838568fc17e9ac6dc7c0705..c14339f9a2a4098194b48d756d5b4c1bebf5eafb 100755 (executable)
@@ -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 $_; },
index d5576f39130d0f3718cd84b37c152aabcd810ecf..edde85685904d6b34444b265b3488c3313ff02e8 100644 (file)
@@ -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; }
index e1a6940ce0459823a23a973881aa087f992299ef..32a7b06f34308f3d859b67a5f1454c3646fd3845 100755 (executable)
@@ -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";
index 91fd0555456e9921b1147ead8faa79a4105e5afc..cdb61cd66bb22028a202c7e8eb9f6cfd635c6702 100644 (file)
@@ -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";
index 6c753c0bd793853eb57be6b1222b90ccff2904d1..660ee5c6545346581535684c5a9fdc25901238bc 100644 (file)
@@ -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 $_ } ,
index 1ef6cab12c916aaa596cfc061b05eaee8c909417..8558a5959e96178762951bd42b6ec9c1b76f40be 100644 (file)
@@ -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">
index 48f03dff133e1d7e2176a312f6ebfdc5fdecf1e8..bcfae488dddeebc4cf674d07fe6a12b8151fb731 100644 (file)
     </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">
index b0da74a1745e6e60c747f08e8cac3bb01d0a889a..a5bdcce276ec38956fbcf8fbd2cbc91dcf1d40df 100644 (file)
@@ -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 %]] -
         [% 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>
index d7214349c204e2e7430b2b4b36e64dc0ca418a51..27551f19d2b5229994efeb8c557bdfc0a23fe160 100644 (file)
               [% 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 %]">
index 05b52c5b80cb29970535cfc7695e45b1315cf624..1c74c3b899ae73b44efb76ae32d4de9e773e6cb8 100644 (file)
 'list/edit-multiple.html.tmpl' => [
   'group.id', 
   'group.description',
-  'group.description FILTER strike', 
+  'group.description FILTER inactive', 
   'knum', 
   'menuname', 
 ],
index 1d758e58e90723ba499889a74a26ab87493e5ce9..d3c23ce66b2efb149e5768ada66d0c32510e884d 100644 (file)
         [% IF group.isactive %]
           [% group.description %]
         [% ELSE %]
-          [% group.description FILTER strike %]
+          [% group.description FILTER inactive %]
         [% END %]
       </td>
 
   </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 %]
index f8ea3a457b9c9f3ad66736dbb723f0188cda6e4f..6017a1e4e2c05929bd7a1615b7e9ab6fcbe60e17 100644 (file)
     <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>