From: Jakub Narebski <jnareb@gmail.com>
To: "Bernhard R. Link" <brl+git@mail.brlink.eu>
Cc: git@vger.kernel.org, Jakub Narebski <jnareb@gmail.com>
Subject: Re: [PATCH v2 2/2] gitweb: place links to parent directories in page header
Date: Sat, 28 Jan 2012 14:54:55 -0800 (PST) [thread overview]
Message-ID: <m3sjizcu8x.fsf@localhost.localdomain> (raw)
In-Reply-To: <20120128165753.GA6795@server.brlink.eu>
"Bernhard R. Link" <brl+git@mail.brlink.eu> writes:
Description?
> Signed-off-by: Bernhard R. Link <brlink@debian.org>
>
> ---
> This patch was not yet part of v1.
>
> I'm not sure this if having this as seperate patch or merged into 1/2
> makes more sense.
While adding links that lead to gitweb URLs with project_filter
parameter set, i.e. linking new feature in, could be postponed to a
later commit, I think some way of notifying client that project list
is filtered would be better to have in 1/2.
> gitweb/gitweb.perl | 23 ++++++++++++++++++++++-
> 1 files changed, 22 insertions(+), 1 deletions(-)
>
> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> index a114bd4..ddce27d 100755
> --- a/gitweb/gitweb.perl
> +++ b/gitweb/gitweb.perl
> @@ -3841,7 +3841,18 @@ sub print_nav_breadcrumbs {
>
> print $cgi->a({-href => esc_url($home_link)}, $home_link_str) . " / ";
> if (defined $project) {
> - print $cgi->a({-href => href(action=>"summary")}, esc_html($project));
> + my @dirname = split '/', $project;
> + my $projectbasename = pop @dirname;
> + my $dirprefix = undef;
> + while (my $part = shift @dirname) {
> + $dirprefix .= "/" if defined $dirprefix;
> + $dirprefix .= $part;
> + print $cgi->a({-href => href(project => undef,
> + project_filter => $dirprefix,
> + action=>"project_list")},
> + esc_html($part)) . " / ";
> + }
> + print $cgi->a({-href => href(action=>"summary")}, esc_html($projectbasename));
> if (defined $action) {
> my $action_print = $action ;
> if (defined $opts{-action_extra}) {
Nice solution.
> @@ -3854,6 +3865,16 @@ sub print_nav_breadcrumbs {
> print " / $opts{-action_extra}";
> }
> print "\n";
> + } elsif (defined $project_filter) {
> + my @dirname = split '/', $project_filter;
> + my $dirprefix = undef;
> + while (my $part = shift @dirname) {
> + $dirprefix .= "/" if defined $dirprefix;
> + $dirprefix .= $part;
> + print $cgi->a({-href => href(project_filter => $dirprefix,
> + action=>"project_list")},
> + esc_html($part)) . " / ";
> + }
> }
> }
Hmmm... I'd have to check how it looks like, but seems like a good
idea... even if there is a little bit of code duplication.
--
Jakub Narebski
next prev parent reply other threads:[~2012-01-28 22:55 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-28 16:56 [PATCH v2 1/2] gitweb: add project_filter to limit project list to a subdirectory Bernhard R. Link
2012-01-28 16:57 ` [PATCH v2 2/2] gitweb: place links to parent directories in page header Bernhard R. Link
2012-01-28 22:54 ` Jakub Narebski [this message]
2012-01-28 22:45 ` [PATCH v2 1/2] gitweb: add project_filter to limit project list to a subdirectory Jakub Narebski
2012-01-29 1:22 ` [PATCH v3] " Bernhard R. Link
2012-01-29 12:54 ` Jakub Narebski
2012-01-29 16:06 ` [PATCH v4 1/2] " Bernhard R. Link
2012-01-29 16:13 ` [PATCH v4 2/2] gitweb: place links to parent directories in page header Bernhard R. Link
2012-01-29 16:46 ` Jakub Narebski
2012-01-29 16:41 ` [PATCH v4 1/2] gitweb: add project_filter to limit project list to a subdirectory Jakub Narebski
2012-01-29 21:06 ` Junio C Hamano
2012-01-29 23:06 ` Jakub Narebski
2012-01-30 9:52 ` Bernhard R. Link
2012-01-30 11:44 ` [PATCH v5 1/5] gitweb: prepare git_get_projects_list for use outside 'forks' Bernhard R. Link
2012-01-30 13:42 ` Jakub Narebski
2012-01-30 14:55 ` [PATCH v5.5 " Bernhard R. Link
2012-01-30 15:40 ` Jakub Narebski
2012-01-30 16:29 ` Bernhard R. Link
2012-01-30 11:45 ` [PATCH v5 2/5] gitweb: add project_filter to limit project list to a subdirectory Bernhard R. Link
2012-01-30 15:57 ` Jakub Narebski
2012-01-30 20:03 ` Bernhard R. Link
2012-01-30 20:05 ` [PATCH 1/6] gitweb: move hard coded .git suffix out of git_get_projects_list Bernhard R. Link
2012-01-30 20:06 ` [PATCH v6 2/6] gitweb: prepare git_get_projects_list for use outside 'forks' Bernhard R. Link
2012-01-30 20:07 ` [PATCH v6 3/6] gitweb: add project_filter to limit project list to a subdirectory Bernhard R. Link
2012-01-30 20:09 ` [PATCH v6 4/6] gitweb: limit links to alternate forms of project_list to active project_filter Bernhard R. Link
2012-01-30 20:09 ` [PATCH v6 5/6] gitweb: show active project_filter in project_list page header Bernhard R. Link
2012-01-30 20:10 ` [PATCH v6 6/6] gitweb: place links to parent directories in " Bernhard R. Link
2012-01-30 20:34 ` [PATCH v5 2/5] gitweb: add project_filter to limit project list to a subdirectory Junio C Hamano
2012-01-30 20:48 ` Jakub Narebski
2012-01-30 21:05 ` Junio C Hamano
2012-01-30 21:08 ` Junio C Hamano
2012-01-30 20:48 ` Bernhard R. Link
2012-02-01 16:59 ` Bernhard R. Link
2012-02-01 20:55 ` Junio C Hamano
2012-01-30 11:47 ` [PATCH 3/5] gitweb: limit links to alternate forms of project_list to active project_filter Bernhard R. Link
2012-01-30 16:09 ` Jakub Narebski
2012-01-30 11:48 ` [PATCH v5 4/5] gitweb: show active project_filter in project_list page header Bernhard R. Link
2012-01-30 16:38 ` Jakub Narebski
2012-01-30 11:50 ` [PATCH v5 5/5] gitweb: place links to parent directories in " Bernhard R. Link
2012-01-30 17:10 ` Jakub Narebski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3sjizcu8x.fsf@localhost.localdomain \
--to=jnareb@gmail.com \
--cc=brl+git@mail.brlink.eu \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).