* [PATCH] gitweb: Identify all summary metadata table rows
@ 2008-10-02 14:25 Petr Baudis
2008-10-03 0:30 ` Shawn O. Pearce
0 siblings, 1 reply; 3+ messages in thread
From: Petr Baudis @ 2008-10-02 14:25 UTC (permalink / raw)
To: git, git; +Cc: Petr Baudis
In the metadata table of the summary page, all rows have their
id (or class in case of URL) set now. This for example lets sites
easily disable fields they do not want to show in their custom
stylesheet (e.g. they are overly technical or irrelevant for the site).
Many of my other patches depend on this, so I would appreciate to hear
as soon as possible if someone has an issue with this patch.
Signed-off-by: Petr Baudis <petr.baudis@novartis.com>
---
gitweb/gitweb.perl | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index da474d0..bd8124a 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -4070,10 +4070,10 @@ sub git_summary {
print "<div class=\"title\"> </div>\n";
print "<table class=\"projects_list\">\n" .
- "<tr><td>description</td><td>" . esc_html($descr) . "</td></tr>\n" .
- "<tr><td>owner</td><td>" . esc_html($owner) . "</td></tr>\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";
if (defined $cd{'rfc2822'}) {
- print "<tr><td>last change</td><td>$cd{'rfc2822'}</td></tr>\n";
+ print "<tr id=\"metadata_lchange\"><td>last change</td><td>$cd{'rfc2822'}</td></tr>\n";
}
# use per project git URL list in $projectroot/$project/cloneurl
@@ -4083,7 +4083,7 @@ sub git_summary {
@url_list = map { "$_/$project" } @git_base_url_list unless @url_list;
foreach my $git_url (@url_list) {
next unless $git_url;
- print "<tr><td>$url_tag</td><td>$git_url</td></tr>\n";
+ print "<tr class=\"metadata_url\"><td>$url_tag</td><td>$git_url</td></tr>\n";
$url_tag = "";
}
print "</table>\n";
--
tg: (c427559..) t/summary/css-metadata (depends on: vanilla/master)
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] gitweb: Identify all summary metadata table rows
2008-10-02 14:25 [PATCH] gitweb: Identify all summary metadata table rows Petr Baudis
@ 2008-10-03 0:30 ` Shawn O. Pearce
2008-10-03 1:04 ` Jakub Narebski
0 siblings, 1 reply; 3+ messages in thread
From: Shawn O. Pearce @ 2008-10-03 0:30 UTC (permalink / raw)
To: Petr Baudis; +Cc: git, Petr Baudis
Petr Baudis <pasky@suse.cz> wrote:
> In the metadata table of the summary page, all rows have their
> id (or class in case of URL) set now. This for example lets sites
> easily disable fields they do not want to show in their custom
> stylesheet (e.g. they are overly technical or irrelevant for the site).
>
> Many of my other patches depend on this, so I would appreciate to hear
> as soon as possible if someone has an issue with this patch.
Its pretty trivial and painless. So its applied. Marking up unique
elements so you can control them via CSS isn't rocket science. ;-)
> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> index da474d0..bd8124a 100755
> --- a/gitweb/gitweb.perl
> +++ b/gitweb/gitweb.perl
> @@ -4070,10 +4070,10 @@ sub git_summary {
>
> print "<div class=\"title\"> </div>\n";
> print "<table class=\"projects_list\">\n" .
> - "<tr><td>description</td><td>" . esc_html($descr) . "</td></tr>\n" .
> - "<tr><td>owner</td><td>" . esc_html($owner) . "</td></tr>\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";
> if (defined $cd{'rfc2822'}) {
> - print "<tr><td>last change</td><td>$cd{'rfc2822'}</td></tr>\n";
> + print "<tr id=\"metadata_lchange\"><td>last change</td><td>$cd{'rfc2822'}</td></tr>\n";
> }
>
> # use per project git URL list in $projectroot/$project/cloneurl
> @@ -4083,7 +4083,7 @@ sub git_summary {
> @url_list = map { "$_/$project" } @git_base_url_list unless @url_list;
> foreach my $git_url (@url_list) {
> next unless $git_url;
> - print "<tr><td>$url_tag</td><td>$git_url</td></tr>\n";
> + print "<tr class=\"metadata_url\"><td>$url_tag</td><td>$git_url</td></tr>\n";
> $url_tag = "";
> }
> print "</table>\n";
--
Shawn.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] gitweb: Identify all summary metadata table rows
2008-10-03 0:30 ` Shawn O. Pearce
@ 2008-10-03 1:04 ` Jakub Narebski
0 siblings, 0 replies; 3+ messages in thread
From: Jakub Narebski @ 2008-10-03 1:04 UTC (permalink / raw)
To: Shawn O. Pearce; +Cc: Petr Baudis, git, Petr Baudis
"Shawn O. Pearce" <spearce@spearce.org> writes:
> Petr Baudis <pasky@suse.cz> wrote:
> > In the metadata table of the summary page, all rows have their
> > id (or class in case of URL) set now. This for example lets sites
> > easily disable fields they do not want to show in their custom
> > stylesheet (e.g. they are overly technical or irrelevant for the site).
> >
> > Many of my other patches depend on this, so I would appreciate to hear
> > as soon as possible if someone has an issue with this patch.
>
> Its pretty trivial and painless. So its applied. Marking up unique
> elements so you can control them via CSS isn't rocket science. ;-)
Somehow original patch didn't appear (yet) on git mailing list;
perhaps it ran afoul vger anti-SPAM filter...
> > + "<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";
> > + print "<tr id=\"metadata_lchange\"><td>last change</td><td>$cd{'rfc2822'}</td></tr>\n";
> > + print "<tr class=\"metadata_url\"><td>$url_tag</td><td>$git_url</td></tr>\n";
I like the idea, and I think this can be seen as beginning to use
either microformats, or RDFa. You have marked those fragments for CSS
to show or hide; microformats are about marking those fragments for
machine to parse. Although microformats usually use 'class' (or 'rel'
for links), not 'id' attribute for classifying data...
--
Jakub Narebski
Poland
ShadeHawk on #git
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-10-03 1:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-02 14:25 [PATCH] gitweb: Identify all summary metadata table rows Petr Baudis
2008-10-03 0:30 ` Shawn O. Pearce
2008-10-03 1:04 ` Jakub Narebski
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).