gitweb: Restore object-named links in item lists
This restores the redundant links removed earlier. It supersedes my patch to stick slashes to tree entries. Sorry about the previous version of the patch, an unrelated snapshot link addition to tree entries slipped through (and it it didn't even compile); I've dropped the idea of snapshot links in tree entries in the meantime anyway. Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <junkio@cox.net>
Petr Baudis committed
Oct 24, 2006 at 05:36 UTC
4777b0141a4812177390da4b6ebc9d40ac3da4b5
1 file changed
+22
-6
gitweb/gitweb.perl
+22
-6
@@ -1789,16 +1789,18 @@ sub git_print_tree_entry {
1789
file_name=>"$basedir$t->{'name'}", %base_key),
1790
-class => "list"}, esc_html($t->{'name'})) . "</td>\n";
1791
print "<td class=\"link\">";
1792
+ print $cgi->a({-href => href(action=>"blob", hash=>$t->{'hash'},
1793
+ file_name=>"$basedir$t->{'name'}", %base_key)},
1794
+ "blob");
1795
if ($have_blame) {
1793
- print $cgi->a({-href => href(action=>"blame", hash=>$t->{'hash'},
1796
+ print " | " .
1797
+ $cgi->a({-href => href(action=>"blame", hash=>$t->{'hash'},
1798
file_name=>"$basedir$t->{'name'}", %base_key)},
1799
"blame");
1800
}
1801
if (defined $hash_base) {
1798
- if ($have_blame) {
1799
- print " | ";
1800
- }
1801
- print $cgi->a({-href => href(action=>"history", hash_base=>$hash_base,
1802
+ print " | " .
1803
+ $cgi->a({-href => href(action=>"history", hash_base=>$hash_base,
1804
hash=>$t->{'hash'}, file_name=>"$basedir$t->{'name'}")},
1805
"history");
1806
}
@@ -1815,8 +1817,12 @@ sub git_print_tree_entry {
1817
esc_html($t->{'name'}));
1818
print "</td>\n";
1819
print "<td class=\"link\">";
1820
+ print $cgi->a({-href => href(action=>"tree", hash=>$t->{'hash'},
1821
+ file_name=>"$basedir$t->{'name'}", %base_key)},
1822
+ "tree");
1823
if (defined $hash_base) {
1819
- print $cgi->a({-href => href(action=>"history", hash_base=>$hash_base,
1824
+ print " | " .
1825
+ $cgi->a({-href => href(action=>"history", hash_base=>$hash_base,
1826
file_name=>"$basedir$t->{'name'}")},
1827
"history");
1828
}
@@ -1899,6 +1905,9 @@ sub git_difftree_body {
1905
print $cgi->a({-href => "#patch$patchno"}, "patch");
1906
print " | ";
1907
}
1908
+ print $cgi->a({-href => href(action=>"blob", hash=>$diff{'from_id'},
1909
+ hash_base=>$parent, file_name=>$diff{'file'})},
1910
+ "blob") . " | ";
1911
print $cgi->a({-href => href(action=>"blame", hash_base=>$parent,
1912
file_name=>$diff{'file'})},
1913
"blame") . " | ";
@@ -1944,6 +1953,9 @@ sub git_difftree_body {
1953
}
1954
print " | ";
1955
}
1956
+ print $cgi->a({-href => href(action=>"blob", hash=>$diff{'to_id'},
1957
+ hash_base=>$hash, file_name=>$diff{'file'})},
1958
+ "blob") . " | ";
1959
print $cgi->a({-href => href(action=>"blame", hash_base=>$hash,
1960
file_name=>$diff{'file'})},
1961
"blame") . " | ";
@@ -1984,6 +1996,9 @@ sub git_difftree_body {
1996
}
1997
print " | ";
1998
}
1999
+ print $cgi->a({-href => href(action=>"blob", hash=>$diff{'from_id'},
2000
+ hash_base=>$parent, file_name=>$diff{'from_file'})},
2001
+ "blob") . " | ";
2002
print $cgi->a({-href => href(action=>"blame", hash_base=>$parent,
2003
file_name=>$diff{'from_file'})},
2004
"blame") . " | ";
@@ -2151,6 +2166,7 @@ sub git_shortlog_body {
2166
href(action=>"commit", hash=>$commit), $ref);
2167
print "</td>\n" .
2168
"<td class=\"link\">" .
2169
+ $cgi->a({-href => href(action=>"commit", hash=>$commit)}, "commit") . " | " .
2170
$cgi->a({-href => href(action=>"commitdiff", hash=>$commit)}, "commitdiff") . " | " .
2171
$cgi->a({-href => href(action=>"tree", hash=>$commit, hash_base=>$commit)}, "tree");
2172
if (gitweb_have_snapshot()) {