git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: Sylvain Rabot <sylvain@abstraction.fr>
Cc: git@vger.kernel.org, Jakub Narebski <jnareb@gmail.com>,
	John 'Warthog9' Hawley <warthog9@kernel.org>
Subject: Re: [PATCH 2/3] gitweb: decorate a bit more remotes
Date: Mon, 20 Dec 2010 14:02:03 -0600	[thread overview]
Message-ID: <20101220200203.GA24163@burratino> (raw)
In-Reply-To: <1292871681-4818-3-git-send-email-sylvain@abstraction.fr>

Sylvain Rabot wrote:

> --- a/gitweb/gitweb.perl
> +++ b/gitweb/gitweb.perl
> @@ -5127,13 +5127,13 @@ sub git_remote_block {
>  
>  	if (defined $fetch) {
>  		if ($fetch eq $push) {
> -			$urls_table .= format_repo_url("URL", $fetch);
> +			$urls_table .= format_repo_url("<span class=\"bold\">URL:</span>", $fetch);
>  		} else {
> -			$urls_table .= format_repo_url("Fetch URL", $fetch);
> -			$urls_table .= format_repo_url("Push URL", $push) if defined $push;
> +			$urls_table .= format_repo_url("<span class=\"bold\">Fetch URL:</span>", $fetch);
> +			$urls_table .= format_repo_url("<span class=\"bold\">Push URL:</span>", $push) if defined $push;

This makes the formatting of the remote URLs table inconsistent with
the other projects_list table (namely the

	description	...
	homepage URL	...
	repository URL	...
	owner	...
	last change	...

table on a repository's summary page).  Is that the right thing
to do?

If so, maybe something like the following would make sense.

-- 8< --
From: Sylvain Rabot <sylvain@abstraction.fr>
Date: Mon, 20 Dec 2010 20:01:20 +0100
Subject: gitweb: decorate a bit more remotes

Put the text "URL" introducing a remote's url in bold and follow it
with a colon.  This makes the url list easier to visually scan.

Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
The justification above is totally made up; I have not checked to
see whether it makes the table easier or harder to read.  Also:
untested.

Maybe the $url part should be esc_url($url)?

 gitweb/gitweb.perl       |   16 ++++++++++------
 gitweb/static/gitweb.css |   13 +++++++++++++
 2 files changed, 23 insertions(+), 6 deletions(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index d521c93..b870b56 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -3862,7 +3862,11 @@ sub git_print_header_div {
 
 sub format_repo_url {
 	my ($name, $url) = @_;
-	return "<tr class=\"metadata_url\"><td>$name</td><td>$url</td></tr>\n";
+	my $row = "<tr class=\"metadata_url\">";
+	$row .= ($name eq "" ? "<td></td>" : "<td class=\"metadata_tag\">$name</td>");
+	$row .= "<td>$url</td>";
+	$row .= "</tr>\n";
+	return $row;
 }
 
 # Group output by placing it in a DIV element and adding a header.
@@ -5122,7 +5126,7 @@ sub git_remote_block {
 	my $fetch = $rdata->{'fetch'};
 	my $push = $rdata->{'push'};
 
-	my $urls_table = "<table class=\"projects_list\">\n" ;
+	my $urls_table = "<table class=\"remote_urls\">\n" ;
 
 	if (defined $fetch) {
 		if ($fetch eq $push) {
@@ -5368,10 +5372,10 @@ sub git_summary {
 
 	print "<div class=\"title\">&nbsp;</div>\n";
 	print "<table class=\"projects_list\">\n" .
-	      "<tr id=\"metadata_desc\"><td>description</td><td>" . esc_html($descr) . "</td></tr>\n" .
-	      "<tr id=\"metadata_owner\"><td>owner</td><td>" . esc_html($owner) . "</td></tr>\n";
+	      "<tr id=\"metadata_desc\"><td class=\"metadata_tag\">description</td><td>" . esc_html($descr) . "</td></tr>\n" .
+	      "<tr id=\"metadata_owner\"><td class=\"metadata_tag\">owner</td><td>" . esc_html($owner) . "</td></tr>\n";
 	if (defined $cd{'rfc2822'}) {
-		print "<tr id=\"metadata_lchange\"><td>last change</td><td>$cd{'rfc2822'}</td></tr>\n";
+		print "<tr id=\"metadata_lchange\"><td class=\"metadata_tag\">last change</td><td>$cd{'rfc2822'}</td></tr>\n";
 	}
 
 	# use per project git URL list in $projectroot/$project/cloneurl
@@ -5390,7 +5394,7 @@ sub git_summary {
 	if ($show_ctags) {
 		my $ctags = git_get_project_ctags($project);
 		my $cloud = git_populate_project_tagcloud($ctags);
-		print "<tr id=\"metadata_ctags\"><td>Content tags:<br />";
+		print "<tr id=\"metadata_ctags\"><td class=\"metadata_tag\">Content tags:<br />";
 		print "</td>\n<td>" unless %$ctags;
 		print "<form action=\"$show_ctags\" method=\"post\"><input type=\"hidden\" name=\"p\" value=\"$project\" />Add: <input type=\"text\" name=\"t\" size=\"8\" /></form>";
 		print "</td>\n<td>" if %$ctags;
diff --git a/gitweb/static/gitweb.css b/gitweb/static/gitweb.css
index 79d7eeb..feb09e5 100644
--- a/gitweb/static/gitweb.css
+++ b/gitweb/static/gitweb.css
@@ -579,6 +579,19 @@ div.remote {
 	display: inline-block;
 }
 
+/*
+ * <b>URL:</b>	http://www.example.com/
+ * <b>Fetch URL:</b>	http://www.example.com/
+ * <b>Push URL:</b>	http://www.example.com/
+ */
+table.remote_urls tr.metadata_url td.metadata_tag:after {
+	content: ":"
+}
+
+table.remote_urls tr.metadata_url td.metadata_tag {
+	font-weight: bold;
+}
+
 /* Style definition generated by highlight 2.4.5, http://www.andre-simon.de/ */
 
 /* Highlighting theme definition: */
-- 
1.7.2.3.554.gc9b5c.dirty

  reply	other threads:[~2010-12-20 20:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-20 19:01 [PATCH 0/3 v2] minor gitweb modifications Sylvain Rabot
2010-12-20 19:01 ` [PATCH 1/3] gitweb: add extensions to highlight feature Sylvain Rabot
2010-12-20 19:01 ` [PATCH 2/3] gitweb: decorate a bit more remotes Sylvain Rabot
2010-12-20 20:02   ` Jonathan Nieder [this message]
2010-12-20 23:06     ` Jakub Narebski
2010-12-20 23:11   ` Jakub Narebski
2010-12-20 19:01 ` [PATCH 3/3] gitweb: remove test when closing file descriptor Sylvain Rabot
  -- strict thread matches above, loose matches on Subject: below --
2010-12-16 21:43 [PATCH 0/3] minor gitweb modifications Sylvain Rabot
2010-12-16 21:43 ` [PATCH 2/3] gitweb: decorate a bit more remotes Sylvain Rabot
2010-12-16 22:23   ` Jakub Narebski
2010-12-20 12:04     ` Drew Northup

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=20101220200203.GA24163@burratino \
    --to=jrnieder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jnareb@gmail.com \
    --cc=sylvain@abstraction.fr \
    --cc=warthog9@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).