* [PATCH/RFC] gitweb: Add title attribute with unshortened value for table cells
@ 2006-06-20 8:12 Jakub Narebski
2006-06-20 9:15 ` Junio C Hamano
0 siblings, 1 reply; 7+ messages in thread
From: Jakub Narebski @ 2006-06-20 8:12 UTC (permalink / raw)
To: git
This allows to see full, unshortened value on mouseover using 'title'
attribute for <td> element. For now it means only author name and
project owner name.
Ugly solution using $cgi->start_td({-title => VALUE})
Doesn't work well with values outside us-ascii, but that might be
considered web browser bug (misfeature), not a bug in gitweb.
---
The idea is to have full value available on mouseover, be it commit title,
author of the commit, project owner, tag name/title or project description.
For now only author name and project owner name are implemented, and
implementation is ugly and results is not perfect.
gitweb/gitweb.cgi | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
b72280ac4649d54375732de771f7d92c7d350258
diff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi
index 1b254df..9a09b20 100755
--- a/gitweb/gitweb.cgi
+++ b/gitweb/gitweb.cgi
@@ -887,7 +887,7 @@ sub git_project_list {
$alternate ^= 1;
print "<td>" . $cgi->a({-href => "$my_uri?" . esc_param("p=$pr->{'path'};a=summary"), -class => "list"}, esc_html($pr->{'path'})) . "</td>\n" .
"<td>$pr->{'descr'}</td>\n" .
- "<td><i>" . chop_str($pr->{'owner'}, 15) . "</i></td>\n";
+ $cgi->start_td({-title => $pr->{'owner'}}) . chop_str($pr->{'owner'}, 15) . "</i></td>\n";
my $colored_age;
if ($pr->{'commit'}{'age'} < 60*60*2) {
$colored_age = "<span style =\"color: #009900;\"><b><i>$pr->{'commit'}{'age_string'}</i></b></span>";
@@ -1057,7 +1057,7 @@ sub git_summary {
$ref = " <span class=\"tag\">" . esc_html($refs->{$commit}) . "</span>";
}
print "<td><i>$co{'age_string'}</i></td>\n" .
- "<td><i>" . esc_html(chop_str($co{'author_name'}, 10)) . "</i></td>\n" .
+ $cgi->start_td({-title => $co{'author_name'}}) . esc_html(chop_str($co{'author_name'}, 10)) . "</i></td>\n" .
"<td>";
if (length($co{'title_short'}) < length($co{'title'})) {
print $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$commit"), -class => "list", -title => "$co{'title'}"},
@@ -2306,7 +2306,7 @@ sub git_history {
}
$alternate ^= 1;
print "<td title=\"$co{'age_string_age'}\"><i>$co{'age_string_date'}</i></td>\n" .
- "<td><i>" . esc_html(chop_str($co{'author_name'}, 15, 3)) . "</i></td>\n" .
+ $cgi->start_td({-title => $co{'author_name'}}) . esc_html(chop_str($co{'author_name'}, 15, 3)) . "</i></td>\n" .
"<td>" . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$commit"), -class => "list"}, "<b>" .
esc_html(chop_str($co{'title'}, 50)) . "$ref</b>") . "</td>\n" .
"<td class=\"link\">" .
@@ -2396,7 +2396,7 @@ sub git_search {
}
$alternate ^= 1;
print "<td title=\"$co{'age_string_age'}\"><i>$co{'age_string_date'}</i></td>\n" .
- "<td><i>" . esc_html(chop_str($co{'author_name'}, 15, 5)) . "</i></td>\n" .
+ $cgi->start_td({-title => $co{'author_name'}}) . esc_html(chop_str($co{'author_name'}, 15, 5)) . "</i></td>\n" .
"<td>" .
$cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$co{'id'}"), -class => "list"}, "<b>" . esc_html(chop_str($co{'title'}, 50)) . "</b><br/>");
my $comment = $co{'comment'};
@@ -2449,7 +2449,7 @@ sub git_search {
}
$alternate ^= 1;
print "<td title=\"$co{'age_string_age'}\"><i>$co{'age_string_date'}</i></td>\n" .
- "<td><i>" . esc_html(chop_str($co{'author_name'}, 15, 5)) . "</i></td>\n" .
+ $cgi->start_td({-title => $co{'author_name'}}) . esc_html(chop_str($co{'author_name'}, 15, 5)) . "</i></td>\n" .
"<td>" .
$cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$co{'id'}"), -class => "list"}, "<b>" .
esc_html(chop_str($co{'title'}, 50)) . "</b><br/>");
@@ -2537,7 +2537,7 @@ sub git_shortlog {
}
$alternate ^= 1;
print "<td title=\"$co{'age_string_age'}\"><i>$co{'age_string_date'}</i></td>\n" .
- "<td><i>" . esc_html(chop_str($co{'author_name'}, 10)) . "</i></td>\n" .
+ $cgi->start_td({-title => $co{'author_name'}}) . esc_html(chop_str($co{'author_name'}, 10)) . "</i></td>\n" .
"<td>";
if (length($co{'title_short'}) < length($co{'title'})) {
print $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$commit"), -class => "list", -title => "$co{'title'}"},
--
1.3.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH/RFC] gitweb: Add title attribute with unshortened value for table cells
2006-06-20 8:12 [PATCH/RFC] gitweb: Add title attribute with unshortened value for table cells Jakub Narebski
@ 2006-06-20 9:15 ` Junio C Hamano
2006-06-20 9:46 ` Timo Hirvonen
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Junio C Hamano @ 2006-06-20 9:15 UTC (permalink / raw)
To: Jakub Narebski; +Cc: git
Jakub Narebski <jnareb@gmail.com> writes:
> Doesn't work well with values outside us-ascii, but that might be
> considered web browser bug (misfeature), not a bug in gitweb.
That's sad.
Are you sure about it?
What does start_td({-title=>"blah"}) produce? <td title="blah">?
If so, is http://members.cox.net/junkio/t.html close to what you
are trying to achieve here?
> "<td>$pr->{'descr'}</td>\n" .
> - "<td><i>" . chop_str($pr->{'owner'}, 15) . "</i></td>\n";
> + $cgi->start_td({-title => $pr->{'owner'}}) . chop_str($pr->{'owner'}, 15) . "</i></td>\n";
Where did the opening <i> go? Not that I care about italics,
since I think this should all be done with stylesheet, but I do
care about unbalanced pairs.
BTW, I haven't nailed down the procedure to update the
kernel.org gitweb installations (I suspect the burden is on me
since Kay orphaned gitweb onto me).
I wonder if there is somebody who is willing to run gitweb from
the "next" branch on some public site, so that I can be
reasonably confident before breaking one of the most important
infrastructure of the kernel development? Volunteers?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH/RFC] gitweb: Add title attribute with unshortened value for table cells
2006-06-20 9:15 ` Junio C Hamano
@ 2006-06-20 9:46 ` Timo Hirvonen
2006-06-20 9:59 ` Jakub Narebski
2006-06-20 9:48 ` Jakub Narebski
2006-06-20 15:28 ` David Woodhouse
2 siblings, 1 reply; 7+ messages in thread
From: Timo Hirvonen @ 2006-06-20 9:46 UTC (permalink / raw)
To: Junio C Hamano; +Cc: jnareb, git
Junio C Hamano <junkio@cox.net> wrote:
> I wonder if there is somebody who is willing to run gitweb from
> the "next" branch on some public site, so that I can be
> reasonably confident before breaking one of the most important
> infrastructure of the kernel development? Volunteers?
I can help.
http://onion.dynserv.net/git/gitweb.cgi
Note: http://onion.dynserv.net/git/ (index.cgi) is an old version.
Global symbol "$path" requires explicit package name at
/var/www/localhost/htdocs/git/gitweb.cgi line 1521.
Execution of /var/www/localhost/htdocs/git/gitweb.cgi aborted due to
compilation errors.
The line is:
$file =~ m#^/# or $file = "$projectroot/$path/$file";
$path seems to be undefined. I don't understand perl very well so I
can't fix it.
--
http://onion.dynserv.net/~timo/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH/RFC] gitweb: Add title attribute with unshortened value for table cells
2006-06-20 9:15 ` Junio C Hamano
2006-06-20 9:46 ` Timo Hirvonen
@ 2006-06-20 9:48 ` Jakub Narebski
2006-06-20 15:28 ` David Woodhouse
2 siblings, 0 replies; 7+ messages in thread
From: Jakub Narebski @ 2006-06-20 9:48 UTC (permalink / raw)
To: git
Junio C Hamano wrote:
> Jakub Narebski <jnareb@gmail.com> writes:
>
>> Doesn't work well with values outside us-ascii, but that might be
>> considered web browser bug (misfeature), not a bug in gitweb.
>
> That's sad.
>
> Are you sure about it?
Now I see I was wrong.
> What does start_td({-title=>"blah"}) produce? <td title="blah">?
> If so, is http://members.cox.net/junkio/t.html close to what you
> are trying to achieve here?
Yes, that is what I tried to achieve. Using CGI to set attributes
was to quote characters which cannot be in double quited attribute values,
i.e. change '"' to '"' or '"'. I don't know what start_td did with
\"o character (Perl v5.8.6, CGI::VERSION=3.05).
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH/RFC] gitweb: Add title attribute with unshortened value for table cells
2006-06-20 9:46 ` Timo Hirvonen
@ 2006-06-20 9:59 ` Jakub Narebski
2006-06-20 10:57 ` Timo Hirvonen
0 siblings, 1 reply; 7+ messages in thread
From: Jakub Narebski @ 2006-06-20 9:59 UTC (permalink / raw)
To: git
Timo Hirvonen wrote:
> http://onion.dynserv.net/git/gitweb.cgi
>
> Global symbol "$path" requires explicit package name at
> /var/www/localhost/htdocs/git/gitweb.cgi line 1521.
> Execution of /var/www/localhost/htdocs/git/gitweb.cgi aborted due to
> compilation errors.
>
> The line is:
>
> $file =~ m#^/# or $file = "$projectroot/$path/$file";
>
> $path seems to be undefined. I don't understand perl very well so I
> can't fix it.
Temporary fix is in:
"[PATCH] Fix: Support for the standard mime.types map in gitweb"
(Message-Id: <11507843541678-git-send-email-jnareb@gmail.com>)
http://permalink.gmane.org/gmane.comp.version-control.git/22172
BTW. I have _my_ version at
http://front.fuw.edu.pl/cgi-bin/jnareb/gitweb.cgi
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH/RFC] gitweb: Add title attribute with unshortened value for table cells
2006-06-20 9:59 ` Jakub Narebski
@ 2006-06-20 10:57 ` Timo Hirvonen
0 siblings, 0 replies; 7+ messages in thread
From: Timo Hirvonen @ 2006-06-20 10:57 UTC (permalink / raw)
To: Jakub Narebski; +Cc: git
Jakub Narebski <jnareb@gmail.com> wrote:
> Timo Hirvonen wrote:
>
> > http://onion.dynserv.net/git/gitweb.cgi
> >
> > Global symbol "$path" requires explicit package name at
> > /var/www/localhost/htdocs/git/gitweb.cgi line 1521.
> > Execution of /var/www/localhost/htdocs/git/gitweb.cgi aborted due to
> > compilation errors.
> >
> > The line is:
> >
> > $file =~ m#^/# or $file = "$projectroot/$path/$file";
> >
> > $path seems to be undefined. I don't understand perl very well so I
> > can't fix it.
>
> Temporary fix is in:
>
> "[PATCH] Fix: Support for the standard mime.types map in gitweb"
> (Message-Id: <11507843541678-git-send-email-jnareb@gmail.com>)
> http://permalink.gmane.org/gmane.comp.version-control.git/22172
Seems to work now. I also enabled blame and it works too. But I noticed
that the search is sometimes broken. If you click a "blob" link and
then try to search something gitweb will complain:
403 Forbidden - Unknown commit object.
"h" parameter is blob, not commit. Shouldn't the h parameter be set to
HEAD always when searching? Searching starts at h so the search results
vary:
http://onion.dynserv.net/git/gitweb.cgi?p=cmus.git&a=search&h=HEAD&s=pickaxe%3Atheme
http://onion.dynserv.net/git/gitweb.cgi?p=cmus.git&a=search&h=fd2d983d51858e25cc71b14b59c787e1683ba7c5&s=pickaxe%3Atheme
--
http://onion.dynserv.net/~timo/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH/RFC] gitweb: Add title attribute with unshortened value for table cells
2006-06-20 9:15 ` Junio C Hamano
2006-06-20 9:46 ` Timo Hirvonen
2006-06-20 9:48 ` Jakub Narebski
@ 2006-06-20 15:28 ` David Woodhouse
2 siblings, 0 replies; 7+ messages in thread
From: David Woodhouse @ 2006-06-20 15:28 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Jakub Narebski, git
On Tue, 2006-06-20 at 02:15 -0700, Junio C Hamano wrote:
> I wonder if there is somebody who is willing to run gitweb from
> the "next" branch on some public site, so that I can be
> reasonably confident before breaking one of the most important
> infrastructure of the kernel development? Volunteers?
Yeah, we can do it on git.infradead.org if you promise to respond
quickly when you break it. Or I can set up a virtual host on
http://git2.infradead.org/ to use the testing version if you'd prefer.
Mail me a SSH public key, I'll give you an account.
--
dwmw2
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2006-06-20 15:28 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-20 8:12 [PATCH/RFC] gitweb: Add title attribute with unshortened value for table cells Jakub Narebski
2006-06-20 9:15 ` Junio C Hamano
2006-06-20 9:46 ` Timo Hirvonen
2006-06-20 9:59 ` Jakub Narebski
2006-06-20 10:57 ` Timo Hirvonen
2006-06-20 9:48 ` Jakub Narebski
2006-06-20 15:28 ` David Woodhouse
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).