gitweb: tree view: eliminate redundant "blob"
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> Signed-off-by: Junio C Hamano <junkio@cox.net>
Luben Tuikov committed
Sep 25, 2006 at 22:38 UTC
4de741b3e1be564233f0de2c6915a859264fe9b0
1 file changed
+17
-16
gitweb/gitweb.perl
+17
-16
@@ -1600,34 +1600,35 @@ sub git_print_tree_entry {
1600
my %base_key = ();
1601
$base_key{hash_base} = $hash_base if defined $hash_base;
1602
1603
+ # The format of a table row is: mode list link. Where mode is
1604
+ # the mode of the entry, list is the name of the entry, an href,
1605
+ # and link is the action links of the entry.
1606
+
1607
print "<td class=\"mode\">" . mode_str($t->{'mode'}) . "</td>\n";
1608
if ($t->{'type'} eq "blob") {
1609
print "<td class=\"list\">" .
1606
- $cgi->a({-href => href(action=>"blob", hash=>$t->{'hash'},
1607
- file_name=>"$basedir$t->{'name'}", %base_key),
1608
- -class => "list"}, esc_html($t->{'name'})) .
1609
- "</td>\n" .
1610
- "<td class=\"link\">" .
1611
- $cgi->a({-href => href(action=>"blob", hash=>$t->{'hash'},
1612
- file_name=>"$basedir$t->{'name'}", %base_key)},
1613
- "blob");
1610
+ $cgi->a({-href => href(action=>"blob", hash=>$t->{'hash'},
1611
+ file_name=>"$basedir$t->{'name'}", %base_key),
1612
+ -class => "list"}, esc_html($t->{'name'})) . "</td>\n";
1613
+ print "<td class=\"link\">";
1614
if ($have_blame) {
1615
- print " | " .
1616
- $cgi->a({-href => href(action=>"blame", hash=>$t->{'hash'},
1617
- file_name=>"$basedir$t->{'name'}", %base_key)},
1618
- "blame");
1615
+ print $cgi->a({-href => href(action=>"blame", hash=>$t->{'hash'},
1616
+ file_name=>"$basedir$t->{'name'}", %base_key)},
1617
+ "blame");
1618
}
1619
if (defined $hash_base) {
1621
- print " | " .
1622
- $cgi->a({-href => href(action=>"history", hash_base=>$hash_base,
1620
+ if ($have_blame) {
1621
+ print " | ";
1622
+ }
1623
+ print $cgi->a({-href => href(action=>"history", hash_base=>$hash_base,
1624
hash=>$t->{'hash'}, file_name=>"$basedir$t->{'name'}")},
1625
"history");
1626
}
1627
print " | " .
1628
$cgi->a({-href => href(action=>"blob_plain",
1629
hash=>$t->{'hash'}, file_name=>"$basedir$t->{'name'}")},
1629
- "raw") .
1630
- "</td>\n";
1630
+ "raw");
1631
+ print "</td>\n";
1632
1633
} elsif ($t->{'type'} eq "tree") {
1634
print "<td class=\"list\">" .