[PATCH 5/5] gitweb: make category headings into links when they are directories

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When $projects_list_category_is_directory is turned on, project
categories can be useful as project filters, so with that setting
gitweb now makes the category headings into project_filter links
(like the breadcrumbs).

Signed-off-by: Tony Finch <dot@xxxxxxxx>
---
 gitweb/gitweb.perl | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 0aab3e0..a02f3e4 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -5838,8 +5838,18 @@ sub git_project_list_body {
 				if ($check_forks) {
 					print "<td></td>\n";
 				}
-				print "<td class=\"category\" colspan=\"5\">".esc_html($cat)."</td>\n";
-				print "</tr>\n";
+				print "<td class=\"category\" colspan=\"5\">";
+				if ($projects_list_directory_is_category) {
+					print $cgi->a({-href =>
+					    href(project => undef,
+					        project_filter => $cat,
+					        action => "project_list"),
+					    -class => "list"},
+					    esc_html($cat));
+				} else {
+					print esc_html($cat);
+				}
+				print "</td>\n</tr>\n";
 			}

 			git_project_list_rows($categories{$cat}, undef, undef, $check_forks);
-- 
2.2.1.68.g56d9796

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]