git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Martin Waitz <tali@admingilde.org>
To: git@vger.kernel.org
Cc: Martin Waitz <tali@admingilde.org>
Subject: [PATCH] gitweb: use common parameter parsing and generation for "o", too.
Date: Thu, 17 Aug 2006 00:28:37 +0200	[thread overview]
Message-ID: <11557673212235-git-send-email-tali@admingilde.org> (raw)
In-Reply-To: <11557673213372-git-send-email-tali@admingilde.org>

The "o" (list order) parameter was handled special.
Now it is generated with the common href() function and parsed together with
all other parameters.

Signed-off-by: Martin Waitz <tali@admingilde.org>
---
 gitweb/gitweb.perl |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 72e687e..ed6bd0e 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -91,6 +91,11 @@ if (defined $action) {
 	}
 }
 
+our $order = $cgi->param('o');
+if (defined $order && $order !~ m/project|descr|owner|age/) {
+	die_error(undef, "Unknown order parameter");
+}
+
 our $project = ($cgi->param('p') || $ENV{'PATH_INFO'});
 if (defined $project) {
 	$project =~ s|^/||;
@@ -197,6 +202,7 @@ sub href(%) {
 		hash_base => "hb",
 		page => "pg",
 		searchtext => "s",
+		order => "o",
 	);
 
 	my %params = @_;
@@ -1577,11 +1583,6 @@ ## =====================================
 ## actions
 
 sub git_project_list {
-	my $order = $cgi->param('o');
-	if (defined $order && $order !~ m/project|descr|owner|age/) {
-		die_error(undef, "Unknown order parameter");
-	}
-
 	my @list = git_get_projects_list();
 	my @projects;
 	if (!@list) {
@@ -1624,7 +1625,7 @@ sub git_project_list {
 		print "<th>Project</th>\n";
 	} else {
 		print "<th>" .
-		      $cgi->a({-href => "$my_uri?" . esc_param("o=project"),
+		      $cgi->a({-href => href(order=>"project"),
 		               -class => "header"}, "Project") .
 		      "</th>\n";
 	}
@@ -1633,7 +1634,7 @@ sub git_project_list {
 		print "<th>Description</th>\n";
 	} else {
 		print "<th>" .
-		      $cgi->a({-href => "$my_uri?" . esc_param("o=descr"),
+		      $cgi->a({-href => href(order=>"descr"),
 		               -class => "header"}, "Description") .
 		      "</th>\n";
 	}
@@ -1642,7 +1643,7 @@ sub git_project_list {
 		print "<th>Owner</th>\n";
 	} else {
 		print "<th>" .
-		      $cgi->a({-href => "$my_uri?" . esc_param("o=owner"),
+		      $cgi->a({-href => href(order=>"owner"),
 		               -class => "header"}, "Owner") .
 		      "</th>\n";
 	}
@@ -1651,7 +1652,7 @@ sub git_project_list {
 		print "<th>Last Change</th>\n";
 	} else {
 		print "<th>" .
-		      $cgi->a({-href => "$my_uri?" . esc_param("o=age"),
+		      $cgi->a({-href => href(order=>"age"),
 		               -class => "header"}, "Last Change") .
 		      "</th>\n";
 	}
-- 
1.4.2.rc2.gf055

  reply	other threads:[~2006-08-16 22:28 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-16 22:28 [PATCH] gitweb: continue consolidation of URL generation Martin Waitz
2006-08-16 22:28 ` Martin Waitz [this message]
2006-08-16 22:28   ` [PATCH] gitweb: support for "fp" parameter Martin Waitz
2006-08-16 22:28     ` [PATCH] gitweb: support for / as home_link Martin Waitz
2006-08-16 22:28       ` [PATCH] gitweb: fix project list if PATH_INFO=="/" Martin Waitz
2006-08-16 22:28         ` [PATCH] gitweb: use action dispatcher for non-project actions, too Martin Waitz
2006-08-17  2:06           ` Junio C Hamano
2006-08-17 15:00             ` Carl Worth
2006-08-18 13:16               ` Petr Baudis
2006-08-18 14:03                 ` Carl Worth
2006-08-18 14:22                   ` Jakub Narebski
2006-08-18 15:40                   ` Petr Baudis
2006-08-17 19:43             ` Martin Waitz
2006-08-17  9:41           ` Jakub Narebski
2006-08-17 19:49             ` Martin Waitz
2006-08-17 20:00               ` Jakub Narebski
2006-08-17  9:35   ` [PATCH] gitweb: use common parameter parsing and generation for "o", too Jakub Narebski
2006-08-17 19:13     ` Martin Waitz
2006-08-17 19:34       ` Jakub Narebski
2006-08-18 20:20         ` Martin Waitz
2006-08-19 10:55           ` Jakub Narebski
2006-08-19 18:33             ` Martin Waitz
2006-08-19 21:44               ` Jakub Narebski
2006-08-17  1:59 ` [PATCH] gitweb: continue consolidation of URL generation Junio C Hamano
2006-08-17 19:32   ` Martin Waitz

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=11557673212235-git-send-email-tali@admingilde.org \
    --to=tali@admingilde.org \
    --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.
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 NNTP newsgroup(s).