From b7fa516b5769052419541b208c7429beabb5eb15 Mon Sep 17 00:00:00 2001 From: "terry%mozilla.org" Date: Fri, 4 Feb 2000 14:08:00 +0000 Subject: [PATCH] Add an optional ability to stagger the headers in the bug list, which is uglier, but often squeezes things better horizontally. git-svn-id: svn://10.0.0.236/trunk@59769 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/webtools/bugzilla/buglist.cgi | 46 +++++++++++++++++++------ mozilla/webtools/bugzilla/colchange.cgi | 16 +++++++++ 2 files changed, 52 insertions(+), 10 deletions(-) diff --git a/mozilla/webtools/bugzilla/buglist.cgi b/mozilla/webtools/bugzilla/buglist.cgi index fc213137b2a..18d8c5c4aec 100755 --- a/mozilla/webtools/bugzilla/buglist.cgi +++ b/mozilla/webtools/bugzilla/buglist.cgi @@ -943,26 +943,52 @@ if ($dotweak) { pnl "
"; } + +my @th; +foreach my $c (@collist) { + if (exists $::needquote{$c}) { + my $h = ""; + if ($::needquote{$c}) { + $h .= ""; + } else { + $h .= ""; + } + if (defined $::sortkey{$c}) { + $h .= "$::title{$c}"; + } else { + $h .= $::title{$c}; + } + $h .= ""; + push(@th, $h); + } +} + my $tablestart = "
ID"; +my $splitheader = 0; +if ($::COOKIE{'SPLITHEADER'}) { + $splitheader = 1; +} -foreach my $c (@collist) { - if (exists $::needquote{$c}) { - if ($::needquote{$c}) { - $tablestart .= ""; - } else { - $tablestart .= ""; +if ($splitheader) { + $tablestart =~ s/$::title{$c}"; - } else { - $tablestart .= $::title{$c}; + for (my $i=1-$pass ; $i<@th ; $i += 2) { + my $h = @th[$i]; + $h =~ s/TH/TH COLSPAN="2" ALIGN="left"/; + $tablestart .= $h; } } +} else { + $tablestart .= join("", @th); } + $tablestart .= "\n"; diff --git a/mozilla/webtools/bugzilla/colchange.cgi b/mozilla/webtools/bugzilla/colchange.cgi index 0cedd515e7f..2d145955bb6 100755 --- a/mozilla/webtools/bugzilla/colchange.cgi +++ b/mozilla/webtools/bugzilla/colchange.cgi @@ -56,6 +56,7 @@ push(@masterlist, ("summary", "summaryfull")); my @collist; if (defined $::FORM{'rememberedquery'}) { + my $splitheader = 0; if (defined $::FORM{'resetit'}) { @collist = @::default_column_list; } else { @@ -64,9 +65,13 @@ if (defined $::FORM{'rememberedquery'}) { push @collist, $i; } } + if (exists $::FORM{'splitheader'}) { + $splitheader = $::FORM{'splitheader'}; + } } my $list = join(" ", @collist); print "Set-Cookie: COLUMNLIST=$list ; path=/ ; expires=Sun, 30-Jun-2029 00:00:00 GMT\n"; + print "Set-Cookie: SPLITHEADER=$::FORM{'splitheader'} ; path=/ ; expires=Sun, 30-Jun-2029 00:00:00 GMT\n"; print "Refresh: 0; URL=buglist.cgi?$::FORM{'rememberedquery'}\n"; print "\n"; print "What a hack.\n"; @@ -81,6 +86,11 @@ if (defined $::COOKIE{'COLUMNLIST'}) { @collist = @::default_column_list; } +my $splitheader = 0; +if ($::COOKIE{'SPLITHEADER'}) { + $splitheader = 1; +} + my %desc; foreach my $i (@masterlist) { @@ -109,6 +119,12 @@ foreach my $i (@masterlist) { print "$desc{$i}
\n"; } print "

\n"; +print BuildPulldown("splitheader", + [["0", "Normal headers (prettier)"], + ["1", "Stagger headers (often makes list more compact)"]], + $splitheader); +print "

\n"; + print "\n"; print "\n"; print "

\n";