[Popcon-developers] popcon page renders like the old style of the main debian website
Stéphane Blondon
stephane.blondon at gmail.com
Mon Dec 23 18:11:29 UTC 2013
Hello,
2013/12/15 Bill Allombert <ballombe at debian.org>:
> The secondary pages like
> <http://popcon.debian.org/main/index.html>
> still carry
> Raw popularity-contest results
> and
> Number of submissions considered: 160932
>
> maybe we should remove them.
>
> Also maybe the secondary pagaes should carry a different 'breadcrumbs'
> (/ Debian Popularity Contest / All reports)
>
I think the attached patch fixes those two remarks.
The patch includes too the copy-paste-adapt from the mainsite debian
footer to the popcon script.
The patch includes a fix on secondary pages: the footer was inside the
main content and not downside. It's possible this bug is old because
it is caused by a div tag not closed.
Is it OK for you?
I didn't subscribe to the list because I help on this script but I
don't plan to continue on popcon after this improvement task.
Merry christmas and happy new year to everyone !
--
Imprimez ce message en A2 et en couleur au moins 500 fois!
Brûlez des arbres!!
-- envoyé depuis ma centrale à charbon
Stéphane
-------------- next part --------------
--- popcon.orig.pl 2013-12-16 23:21:39.000000000 +0100
+++ popcon.pl 2013-12-23 18:51:26.915905480 +0100
@@ -49,7 +49,12 @@
sub htmlheader
{
my $name = $_[0];
+ my $sec = $_[1];
my $report_label = $poptext{$name};
+ if ($sec){
+ $report_label = "$poptext{$name} ($sec)";
+ }
+
print HTML <<"EOH";
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
@@ -88,8 +93,13 @@
sub popconintro
{
- my ($name, $page) = @_;
- &htmlheader($name);
+ my ($name, $sec, $htmlfile) = @_;
+ my $page = ${htmlfile};
+ if ($sec) {
+ $page = "${sec}/${htmlfile}";
+ }
+
+ &htmlheader($name, $sec);
print HTML <<"EOF";
<div id="content">
<h1>Debian Popularity Contest</h1>
@@ -149,7 +159,6 @@
print HTML <<"EOF";
</ul>
</div>
-<div id="main">
EOF
}
@@ -182,9 +191,10 @@
<div id="footer">
Made by <a href="mailto:ballombe\@debian.org">Bill Allombert</a>. Last generated on $date UTC. <br>
<a href="http://popcon.alioth.debian.org" > Popularity-contest project </a> by Avery Pennarun, Bill Allombert and Petter Reinholdtsen.
-<BR>
-Copyright (C) 2004-2013 <a href="http://www.spi-inc.org/">SPI</a>;
-See <a href="http://www.debian.org/license">license terms</a>.
+<br>
+Copyright © 1997-2013
+<a href="http://www.spi-inc.org/">SPI</a> and others; See <a href="http://www.debian.org/license" rel="copyright">license terms</a><br>
+Debian is a registered <a href="http://www.debian.org/trademark">trademark</a> of Software in the Public Interest, Inc.
</div>
</body>
</html>
@@ -375,7 +385,8 @@
{
open HTML , ">:utf8", "$popcon/$sec/index.html";
opendir SEC,"$popcon/$sec";
- popconintro($name,"$sec/index.html");
+ popconintro($name, $sec, "index.html");
+ printf HTML ("<div id=\"main\">");
printf HTML ("<p>Statistics for the section %-16s sorted by fields: ",$sec);
print_by (".",$_) for (@fields);
print HTML ("\n </p> \n");
@@ -390,7 +401,7 @@
print HTML ("\n");
}
print HTML ("\n </pre>\n");
- rawresults($numsub, $popfile);
+ printf HTML ("</div><!-- close main-->");
htmlfooter;
closedir SEC;
close HTML;
@@ -399,7 +410,8 @@
{
open HTML , ">:utf8", "$popcon/$sec/first.html";
opendir SEC,"$popcon/$sec";
- popconintro($name,"$sec/first.html");
+ popconintro($name, $sec, "first.html");
+ printf HTML ("<div id=\"main\">");
printf HTML ("<p>First package in section %-16s for fields: ",$sec);
for $f (@fields)
{
@@ -426,13 +438,14 @@
print HTML ("\n");
}
print HTML ("\n </pre>\n");
- rawresults($numsub, $popfile);
+ printf HTML ("</div><!-- close main-->");
htmlfooter;
closedir SEC;
close HTML;
}
open HTML , ">:utf8", "$popcon/index.html";
- popconintro($name,"index.html");
+ popconintro($name, "", "index.html");
+ printf HTML ("<div id=\"main\">");
printf HTML ("<h2>Download</h2>");
printf HTML ("<p>Statistics for the whole archive sorted by fields: <pre>");
print_by (".",$_) for (@fields);
@@ -531,8 +544,9 @@
</td>
</tr></table>
<p>
-</p></div>
+</p>
EOF
+ printf HTML ("</div><!-- close main-->");
htmlfooter;
close HTML;
}
More information about the Popcon-developers
mailing list