git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gitweb: tree view: eliminate redundant "blob"
@ 2006-09-26  5:38 Luben Tuikov
  2006-09-26  6:34 ` Junio C Hamano
  2006-09-26  8:54 ` Jakub Narebski
  0 siblings, 2 replies; 33+ messages in thread
From: Luben Tuikov @ 2006-09-26  5:38 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 485 bytes --]

Binary and non-binary blobs:

The "list" table element of tree view is identical
to the "blob" link part of the link table element.
I.e. clicking on "blob" is identical to clicking on
the entry itself.

Thus, eliminate "blob" from being shown -- the user
can get identical result by simply clicking on the
entry itself.

Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
---
 gitweb/gitweb.perl |   33 +++++++++++++++++----------------
 1 files changed, 17 insertions(+), 16 deletions(-)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 1207600725-p1.txt --]
[-- Type: text/inline; name="p1.txt", Size: 2304 bytes --]

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 66be619..c7ab3b6 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -1600,34 +1600,35 @@ sub git_print_tree_entry {
 	my %base_key = ();
 	$base_key{hash_base} = $hash_base if defined $hash_base;
 
+	# The format of a table row is: mode list link.  Where mode is
+	# the mode of the entry, list is the name of the entry, an href,
+	# and link is the action links of the entry.
+
 	print "<td class=\"mode\">" . mode_str($t->{'mode'}) . "</td>\n";
 	if ($t->{'type'} eq "blob") {
 		print "<td class=\"list\">" .
-		      $cgi->a({-href => href(action=>"blob", hash=>$t->{'hash'},
-		                             file_name=>"$basedir$t->{'name'}", %base_key),
-		              -class => "list"}, esc_html($t->{'name'})) .
-		      "</td>\n" .
-		      "<td class=\"link\">" .
-		      $cgi->a({-href => href(action=>"blob", hash=>$t->{'hash'},
-		                             file_name=>"$basedir$t->{'name'}", %base_key)},
-		              "blob");
+			$cgi->a({-href => href(action=>"blob", hash=>$t->{'hash'},
+					       file_name=>"$basedir$t->{'name'}", %base_key),
+				 -class => "list"}, esc_html($t->{'name'})) . "</td>\n";
+		print "<td class=\"link\">";
 		if ($have_blame) {
-			print " | " .
-				$cgi->a({-href => href(action=>"blame", hash=>$t->{'hash'},
-				                       file_name=>"$basedir$t->{'name'}", %base_key)},
-				        "blame");
+			print $cgi->a({-href => href(action=>"blame", hash=>$t->{'hash'},
+						     file_name=>"$basedir$t->{'name'}", %base_key)},
+				      "blame");
 		}
 		if (defined $hash_base) {
-			print " | " .
-			      $cgi->a({-href => href(action=>"history", hash_base=>$hash_base,
+			if ($have_blame) {
+				print " | ";
+			}
+			print $cgi->a({-href => href(action=>"history", hash_base=>$hash_base,
 			                             hash=>$t->{'hash'}, file_name=>"$basedir$t->{'name'}")},
 			              "history");
 		}
 		print " | " .
 		      $cgi->a({-href => href(action=>"blob_plain",
 		                             hash=>$t->{'hash'}, file_name=>"$basedir$t->{'name'}")},
-		              "raw") .
-		      "</td>\n";
+		              "raw");
+		print "</td>\n";
 
 	} elsif ($t->{'type'} eq "tree") {
 		print "<td class=\"list\">" .
-- 
1.4.2.1.gdbbb

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

end of thread, other threads:[~2006-10-05  0:15 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-26  5:38 [PATCH] gitweb: tree view: eliminate redundant "blob" Luben Tuikov
2006-09-26  6:34 ` Junio C Hamano
2006-09-26 17:04   ` Luben Tuikov
2006-09-26  8:54 ` Jakub Narebski
2006-09-26  9:22   ` Jakub Narebski
2006-09-26 16:07   ` Petr Baudis
2006-09-26 16:24     ` Jakub Narebski
2006-09-26 20:33     ` Luben Tuikov
2006-09-27  2:40     ` Junio C Hamano
2006-10-01 18:49       ` Jakub Narebski
2006-09-26 20:14   ` Luben Tuikov
2006-09-26 20:31     ` Jakub Narebski
2006-09-26 21:32       ` Luben Tuikov
2006-09-26 22:24         ` Jakub Narebski
2006-09-26 22:30           ` Jakub Narebski
2006-09-27  6:42         ` Junio C Hamano
2006-10-01 18:41           ` Jakub Narebski
2006-10-01 18:56             ` Junio C Hamano
2006-10-01 19:27               ` Jakub Narebski
2006-10-02  7:15                 ` Andreas Ericsson
2006-10-02 10:56                   ` Jakub Narebski
2006-10-02  7:34               ` Junio C Hamano
2006-10-02 11:06                 ` Jakub Narebski
2006-10-02 19:46               ` Luben Tuikov
2006-10-02 19:11             ` Luben Tuikov
2006-10-02 20:03               ` Jakub Narebski
2006-10-03  4:14                 ` Junio C Hamano
2006-10-03  8:18                   ` Jakub Narebski
2006-10-03  9:34                     ` Junio C Hamano
2006-10-03 10:15                       ` Jakub Narebski
2006-10-05  0:15                       ` Luben Tuikov
2006-10-03 20:20                     ` Luben Tuikov
2006-10-03 16:31                   ` Linus Torvalds

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).