git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] gitweb: CSS cleanup, part 1
@ 2007-11-19 13:16 Jakub Narebski
  2007-11-19 13:16 ` [PATCH 1/2] gitweb: Style all tables using CSS Jakub Narebski
  2007-11-19 13:16 ` [PATCH 2/2] gitweb: Put project README in div.readme, fix its padding Jakub Narebski
  0 siblings, 2 replies; 5+ messages in thread
From: Jakub Narebski @ 2007-11-19 13:16 UTC (permalink / raw)
  To: git

This series of (independent) patches is low hanging fruit of gitweb's
CSS cleanup and fixes. In the second part I plan on large
reorganization of CSS file to make it easier to read, understand,
and modify.

Jakub Narebski (2):
      gitweb: Style all tables using CSS
      gitweb: Put project README in div.readme, fix its padding

Diffstat:
 gitweb/gitweb.css  |    8 ++++----
 gitweb/gitweb.perl |   26 ++++++++++++++------------
 2 files changed, 18 insertions(+), 16 deletions(-)

-- 
Jakub Narebski

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] gitweb: Style all tables using CSS
  2007-11-19 13:16 [PATCH 0/2] gitweb: CSS cleanup, part 1 Jakub Narebski
@ 2007-11-19 13:16 ` Jakub Narebski
  2007-11-19 14:27   ` Bernt Hansen
  2007-11-19 13:16 ` [PATCH 2/2] gitweb: Put project README in div.readme, fix its padding Jakub Narebski
  1 sibling, 1 reply; 5+ messages in thread
From: Jakub Narebski @ 2007-11-19 13:16 UTC (permalink / raw)
  To: git; +Cc: Jakub Narebski

Remove all cellspacing="0" attributes from tables in gitweb,
replacing it by CSS rule.  Add CSS classes for all tables.

While at it, change class(es) of table for commit message and commit
authorship search from "grep" to "commit_search"; similarly,
"grep_search" class is now used for table with results of grep (files)
search.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
All tables now get equivalent of 'cellspacing="0"' attribute.

 gitweb/gitweb.css  |    4 ----
 gitweb/gitweb.perl |   22 +++++++++++-----------
 2 files changed, 11 insertions(+), 15 deletions(-)

diff --git a/gitweb/gitweb.css b/gitweb/gitweb.css
index 1b88879..17c60e4 100644
--- a/gitweb/gitweb.css
+++ b/gitweb/gitweb.css
@@ -170,14 +170,10 @@ a.text:hover {
 
 table {
 	padding: 8px 4px;
-}
-
-table.project_list {
 	border-spacing: 0;
 }
 
 table.diff_tree {
-	border-spacing: 0;
 	font-family: monospace;
 }
 
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index e788ef9..3d532dc 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -3544,7 +3544,7 @@ sub git_shortlog_body {
 	$from = 0 unless defined $from;
 	$to = $#{$commitlist} if (!defined $to || $#{$commitlist} < $to);
 
-	print "<table class=\"shortlog\" cellspacing=\"0\">\n";
+	print "<table class=\"shortlog\">\n";
 	my $alternate = 1;
 	for (my $i = $from; $i <= $to; $i++) {
 		my %co = %{$commitlist->[$i]};
@@ -3590,7 +3590,7 @@ sub git_history_body {
 	$from = 0 unless defined $from;
 	$to = $#{$commitlist} unless (defined $to && $to <= $#{$commitlist});
 
-	print "<table class=\"history\" cellspacing=\"0\">\n";
+	print "<table class=\"history\">\n";
 	my $alternate = 1;
 	for (my $i = $from; $i <= $to; $i++) {
 		my %co = %{$commitlist->[$i]};
@@ -3650,7 +3650,7 @@ sub git_tags_body {
 	$from = 0 unless defined $from;
 	$to = $#{$taglist} if (!defined $to || $#{$taglist} < $to);
 
-	print "<table class=\"tags\" cellspacing=\"0\">\n";
+	print "<table class=\"tags\">\n";
 	my $alternate = 1;
 	for (my $i = $from; $i <= $to; $i++) {
 		my $entry = $taglist->[$i];
@@ -3713,7 +3713,7 @@ sub git_heads_body {
 	$from = 0 unless defined $from;
 	$to = $#{$headlist} if (!defined $to || $#{$headlist} < $to);
 
-	print "<table class=\"heads\" cellspacing=\"0\">\n";
+	print "<table class=\"heads\">\n";
 	my $alternate = 1;
 	for (my $i = $from; $i <= $to; $i++) {
 		my $entry = $headlist->[$i];
@@ -3750,7 +3750,7 @@ sub git_search_grep_body {
 	$from = 0 unless defined $from;
 	$to = $#{$commitlist} if (!defined $to || $#{$commitlist} < $to);
 
-	print "<table class=\"grep\" cellspacing=\"0\">\n";
+	print "<table class=\"commit_search\">\n";
 	my $alternate = 1;
 	for (my $i = $from; $i <= $to; $i++) {
 		my %co = %{$commitlist->[$i]};
@@ -3891,7 +3891,7 @@ sub git_summary {
 	git_print_page_nav('summary','', $head);
 
 	print "<div class=\"title\">&nbsp;</div>\n";
-	print "<table cellspacing=\"0\">\n" .
+	print "<table class=\"projects_list\">\n" .
 	      "<tr><td>description</td><td>" . esc_html($descr) . "</td></tr>\n" .
 	      "<tr><td>owner</td><td>" . esc_html($owner) . "</td></tr>\n";
 	if (defined $cd{'rfc2822'}) {
@@ -3965,7 +3965,7 @@ sub git_tag {
 
 	git_print_header_div('commit', esc_html($tag{'name'}), $hash);
 	print "<div class=\"title_text\">\n" .
-	      "<table cellspacing=\"0\">\n" .
+	      "<table class=\"object_header\">\n" .
 	      "<tr>\n" .
 	      "<td>object</td>\n" .
 	      "<td>" . $cgi->a({-class => "list", -href => href(action=>$tag{'type'}, hash=>$tag{'object'})},
@@ -4405,7 +4405,7 @@ sub git_tree {
 	}
 	git_print_page_path($file_name, 'tree', $hash_base);
 	print "<div class=\"page_body\">\n";
-	print "<table cellspacing=\"0\">\n";
+	print "<table class=\"tree\">\n";
 	my $alternate = 1;
 	# '..' (top directory) link if possible
 	if (defined $hash_base &&
@@ -4627,7 +4627,7 @@ sub git_commit {
 		git_print_header_div('tree', esc_html($co{'title'}) . $ref, $co{'tree'}, $hash);
 	}
 	print "<div class=\"title_text\">\n" .
-	      "<table cellspacing=\"0\">\n";
+	      "<table class=\"object_header\">\n";
 	print "<tr><td>author</td><td>" . esc_html($co{'author'}) . "</td></tr>\n".
 	      "<tr>" .
 	      "<td></td><td> $ad{'rfc2822'}";
@@ -5226,7 +5226,7 @@ sub git_search {
 		git_print_page_nav('','', $hash,$co{'tree'},$hash);
 		git_print_header_div('commit', esc_html($co{'title'}), $hash);
 
-		print "<table cellspacing=\"0\">\n";
+		print "<table class=\"pickaxe search\">\n";
 		my $alternate = 1;
 		$/ = "\n";
 		my $git_command = git_cmd_str();
@@ -5293,7 +5293,7 @@ sub git_search {
 		git_print_page_nav('','', $hash,$co{'tree'},$hash);
 		git_print_header_div('commit', esc_html($co{'title'}), $hash);
 
-		print "<table cellspacing=\"0\">\n";
+		print "<table class=\"grep_search\">\n";
 		my $alternate = 1;
 		my $matches = 0;
 		$/ = "\n";
-- 
1.5.3.5

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] gitweb: Put project README in div.readme, fix its padding
  2007-11-19 13:16 [PATCH 0/2] gitweb: CSS cleanup, part 1 Jakub Narebski
  2007-11-19 13:16 ` [PATCH 1/2] gitweb: Style all tables using CSS Jakub Narebski
@ 2007-11-19 13:16 ` Jakub Narebski
  1 sibling, 0 replies; 5+ messages in thread
From: Jakub Narebski @ 2007-11-19 13:16 UTC (permalink / raw)
  To: git; +Cc: Jakub Narebski

Put (optional) projects README on "summary" page in <div> element
using "readme" class.  This allow to style it using CSS.

Add padding to project's README to make it line out with the rest
of the page.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
 gitweb/gitweb.css  |    4 ++++
 gitweb/gitweb.perl |    4 +++-
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/gitweb/gitweb.css b/gitweb/gitweb.css
index 17c60e4..446a1c3 100644
--- a/gitweb/gitweb.css
+++ b/gitweb/gitweb.css
@@ -85,6 +85,10 @@ div.title, a.title {
 	color: #000000;
 }
 
+div.readme {
+	padding: 8px;
+}
+
 a.title:hover {
 	background-color: #d9d8d1;
 }
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 3d532dc..491a3f4 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -3912,8 +3912,10 @@ sub git_summary {
 
 	if (-s "$projectroot/$project/README.html") {
 		if (open my $fd, "$projectroot/$project/README.html") {
-			print "<div class=\"title\">readme</div>\n";
+			print "<div class=\"title\">readme</div>\n" .
+			      "<div class=\"readme\">\n";
 			print $_ while (<$fd>);
+			print "\n</div>\n"; # class="readme"
 			close $fd;
 		}
 	}
-- 
1.5.3.5

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] gitweb: Style all tables using CSS
  2007-11-19 13:16 ` [PATCH 1/2] gitweb: Style all tables using CSS Jakub Narebski
@ 2007-11-19 14:27   ` Bernt Hansen
  2007-11-19 15:08     ` Jakub Narebski
  0 siblings, 1 reply; 5+ messages in thread
From: Bernt Hansen @ 2007-11-19 14:27 UTC (permalink / raw)
  To: Jakub Narebski; +Cc: git

Jakub Narebski <jnareb@gmail.com> writes:

> -	print "<table cellspacing=\"0\">\n" .
> +	print "<table class=\"projects_list\">\n" .

Should this class be "project_list" instead?  I don't see a definition
of "projects_list" (plural) anywhere.

Bernt

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] gitweb: Style all tables using CSS
  2007-11-19 14:27   ` Bernt Hansen
@ 2007-11-19 15:08     ` Jakub Narebski
  0 siblings, 0 replies; 5+ messages in thread
From: Jakub Narebski @ 2007-11-19 15:08 UTC (permalink / raw)
  To: Bernt Hansen; +Cc: git

Bernt Hansen wrote:
> Jakub Narebski <jnareb@gmail.com> writes:
> 
> > -	print "<table cellspacing=\"0\">\n" .
> > +	print "<table class=\"projects_list\">\n" .
> 
> Should this class be "project_list" instead?  I don't see a definition
> of "projects_list" (plural) anywhere.

Now that you mentioned it, I have checked and... we have a bit of 
inconsistency in gitweb here. There are $projects_list and 
$projects_list_description_width variables (plural), 
git_get_projects_list subroutine (also plural), but view is called 
'project_list', it is generated by git_project_list subroutine using 
git_get_project_list_from_file and git_project_lis_body subroutines.

I am not native English speaker: gitweb mean here "list of projects".
We should probably uniqueify number to either plural or singular, and 
not mixed as it is now. But this is a bit of nitpicking/paintshed...

Changing action name from 'project_list' would be hard because of 
backward compatibility... _if_ we officially used this action; it is 
default action when no project is selected, and all links use this 
form.

-- 
Jakub Narebski
Poland

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-11-19 15:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-19 13:16 [PATCH 0/2] gitweb: CSS cleanup, part 1 Jakub Narebski
2007-11-19 13:16 ` [PATCH 1/2] gitweb: Style all tables using CSS Jakub Narebski
2007-11-19 14:27   ` Bernt Hansen
2007-11-19 15:08     ` Jakub Narebski
2007-11-19 13:16 ` [PATCH 2/2] gitweb: Put project README in div.readme, fix its padding Jakub Narebski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).