All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 5/5] gitweb: make category headings into links when they are directories
@ 2014-07-31 12:53 Tony Finch
  0 siblings, 0 replies; 4+ messages in thread
From: Tony Finch @ 2014-07-31 12:53 UTC (permalink / raw)
  To: git

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@dotat.at>
---
 gitweb/gitweb.perl | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index edbc058..32e65ae 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -5834,8 +5834,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.1.0.rc0.229.gaee38de

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

* Re: [PATCH 5/5] gitweb: make category headings into links when they are directories
  2015-03-26 19:49   ` Junio C Hamano
@ 2015-03-27  0:14     ` Tony Finch
  0 siblings, 0 replies; 4+ messages in thread
From: Tony Finch @ 2015-03-27  0:14 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Jakub Narębski, Luben Tuikov, git


> On 26 Mar 2015, at 19:49, Junio C Hamano <gitster@pobox.com> wrote:
> 
> Any comments from those who use or have their own code in Gitweb on
> this topic?

Thanks for chasing up my patches. I should have written a covering letter, to say that you can see these patches in action at https://git.csx.cam.ac.uk/x/ucs/ - try clicking on the category headings, and observe the pathinfo, breadcrumbs, and links under the search box.

Tony.
-- 
f.anthony.n.finch  <dot@dotat.at>  http://dotat.at

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

* Re: [PATCH 5/5] gitweb: make category headings into links when they are directories
  2015-03-19 15:40 ` Tony Finch
@ 2015-03-26 19:49   ` Junio C Hamano
  2015-03-27  0:14     ` Tony Finch
  0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2015-03-26 19:49 UTC (permalink / raw)
  To: Jakub Narębski, Luben Tuikov; +Cc: git, Tony Finch

Any comments from those who use or have their own code in Gitweb on
this topic?

* tf/gitweb-project-listing (2015-03-19) 5 commits
 - gitweb: make category headings into links when they are directories
 - gitweb: optionally set project category from its pathname
 - gitweb: add a link under the search box to clear a project filter
 - gitweb: if the PATH_INFO is incomplete, use it as a project_filter
 - gitweb: fix typo in man page

 Update gitweb to make it more pleasant to deal with a hierarchical
 forest of repositories.

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

* [PATCH 5/5] gitweb: make category headings into links when they are directories
       [not found] <5e56772f50d3d1498361d8831c4f2fba38d197b4.1426779553.git.dot@dotat.at>
@ 2015-03-19 15:40 ` Tony Finch
  2015-03-26 19:49   ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Tony Finch @ 2015-03-19 15:40 UTC (permalink / raw)
  To: git

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@dotat.at>
---
 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

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

end of thread, other threads:[~2015-03-27  0:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-31 12:53 [PATCH 5/5] gitweb: make category headings into links when they are directories Tony Finch
     [not found] <5e56772f50d3d1498361d8831c4f2fba38d197b4.1426779553.git.dot@dotat.at>
2015-03-19 15:40 ` Tony Finch
2015-03-26 19:49   ` Junio C Hamano
2015-03-27  0:14     ` Tony Finch

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.