From: Jonathan Nieder Date: Mon, 20 Dec 2010 20:02:03 GMT Subject: Re: [PATCH 2/3] gitweb: decorate a bit more remotes Message-ID: <20101220200203.GA24163@burratino> 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("URL:", $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("Fetch URL:", $fetch); > + $urls_table .= format_repo_url("Push URL:", $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 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 Signed-off-by: Jonathan Nieder --- 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 "$name$url\n"; + my $row = ""; + $row .= ($name eq "" ? "" : "$name"); + $row .= "$url"; + $row .= "\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 = "\n" ; + my $urls_table = "
\n" ; if (defined $fetch) { if ($fetch eq $push) { @@ -5368,10 +5372,10 @@ sub git_summary { print "
 
\n"; print "
\n" . - "\n" . - "\n"; + "\n" . + "\n"; if (defined $cd{'rfc2822'}) { - print "\n"; + print "\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 "\n\n
description" . esc_html($descr) . "
owner" . esc_html($owner) . "
" . esc_html($descr) . "
" . esc_html($owner) . "
last change$cd{'rfc2822'}
$cd{'rfc2822'}
Content tags:
"; + print "
" unless %$ctags; print "
Add:
"; print "
" 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; } +/* + * URL: http://www.example.com/ + * Fetch URL: http://www.example.com/ + * Push URL: 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