--- ossp_pkg.wml 2002/02/14 17:02:49 1.1
+++ ossp_pkg.wml 2002/02/14 20:16:36 1.2
@@ -28,48 +28,73 @@
<restore width pdone cdone ctext ctodo/>
</define-tag>
-
-# define a <filelist> tag which can be used to create a file listing which
-# is optically more compact than the stuff Apache's mod_autoindex creates.
-# Especially the current version is marked red, too.
+# define a macro which can be used to create a file listing which
+# is optically more compact than the stuff Apache's mod_autoindex
+# creates.
+..PAGE_CSS>>
+TR.files0N { background: #f5f5f0; }
+TR.files1N { background: #e5e5e0; }
+.files0N,.files1N,A.files0N,A.files1N { color: #000000; }
+TR.files0S,TR.files1S { background: #993333; }
+.files0S,.files1S,A.files0S,A.files1S { color: #ffffff; }
+TR.files0U,TR.files1U { background: #666699; }
+.files0U,.files1U,A.files0U,A.files1U { color: #ffffff; }
+<<..
<define-tag pkg_files>
<preserve url>
<preserve directory>
<preserve files>
+<preserve stable>
+<preserve unstable>
<set-var %attributes>
-<table width=100% cellspacing=1 cellpadding=0 border=0>
-<tr>
- <td>File</td>
- <td align=right>Bytes</td><td align=right>Timestamp</td>
-</tr>
<:
my $url = "<get-var url>";
-$url =~ s|/+$||sg;
my $directory = "<get-var directory>";
my $files = "<get-var files>";
-my $highlight = "<get-var highlight>";
+my $stable = "<get-var stable>";
+my $unstable = "<get-var unstable>";
+$url =~ s|/+$||s;
+:>
+<table width=100% cellspacing=1 cellpadding=0 border=0>
+<tr>
+ <td colspan=3>
+ <b>Location:</b> <a href="<get-var url>" class=plain><get-var url></a>
+ </td>
+</tr>
+<tr>
+ <td><b>File:</b></td>
+ <td align=right><b>Size:</b></td>
+ <td align=right><b>Time:</b></td>
+</tr>
+<:
my $odir = chdir($directory) || die;
my @F = reverse sort { (stat($a))[9] <=> (stat($b))[9]; } (glob($files));
chdir($odir);
my $O = '';
-@COL = (
- '#e5e5e0',
- 'NONE',
-);
-$ncol = 1;
+$ncol = 0;
foreach my $f (@F) {
my @S = stat($f);
+ my $size = $S[7];
+ if ($size > (1024*1024)) {
+ $size = sprintf("%.1fMB", $size / (1024*1024));
+ }
+ elsif ($size > (1024)) {
+ $size = sprintf("%.1fKB", $size / (1024));
+ }
$f = "$f/" if (-d $f);
my @T = localtime($S[9]);
my @moy = ('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec');
- $f = "<a href=\"".$url."/".$f."\">$f</a>";
$ncol = ($ncol + 1) % 2;
- $col = $COL[$ncol];
- my $e = ($col eq "NONE" ? "<tr>" : "<tr bgcolor=\"$col\">").
- "<td width=100%>".$f." </td>" .
- "<td align=right> ".$S[7]."</td>" .
- "<td align=right> ".sprintf("%"."02d-%"."s-%"."04d", $T[3], $moy[$T[4]], 1900+$T[5]) . "</td>".
+ my $type = "N";
+ $type = "S" if ($f eq $stable);
+ $type = "U" if ($f eq $unstable);
+ my $class = "files${ncol}${type}";
+ $f = "<a href=\"".$url."/".$f."\" class=$class>$f</a>";
+ my $e = "<tr class=$class>" .
+ " <td width=100%>".$f." </td>" .
+ " <td align=right> ".$size."</td>" .
+ " <td align=right> ".sprintf("%"."02d-%"."s-%"."04d", $T[3], $moy[$T[4]], 1900+$T[5]) . "</td>".
"</tr>";
$O .= $e . "\n";
}
@@ -79,6 +104,8 @@
<restore url>
<restore directory>
<restore files>
+<restore stable>
+<restore unstable>
</define-tag>
# define a package summary list
@@ -113,12 +140,12 @@
<a href="<get-var name>/"><b><get-var longname></b></a>
<ifeq "<get-var derived>" "yes" " <b>*</b>">
</td>
- <td>stable:
+ <td>Stable:
<ifeq "<get-var stable>" "none" "none"
<a href="ftp://ftp.ossp.org/pkg/tool/<get-var name>/<get-var name>-<get-var stable>.tar.gz"><get-var stable></a>
>
</td>
- <td>unstable:
+ <td>Unstable:
<ifeq "<get-var unstable>" "none" "none"
<a href="ftp://ftp.ossp.org/pkg/tool/<get-var name>/<get-var name>-<get-var unstable>.tar.gz"><get-var unstable></a>
>
@@ -148,14 +175,18 @@
<set-var %attributes>
<table cellspacing=0 cellpadding=0 border=0>
<tr>
- <td>Stable Version:</td><td><get-var stable></td><td> (<get-var stable_date>)</td>
- </tr>
- <tr>
- <td>Unstable Version: </td><td><get-var unstable></td><td> (<get-var unstable_date>)</td>
- </tr>
- <tr>
- <td>Done:</td><td colspan=2><pbar width=100 pdone="<get-var done>" cdone="#b5b5b0" ctext="#f5f5f0" ctodo="#996666"></td>
+ <td>Stable Version: </td><td class=heavy><get-var stable></td><td> (<get-var stable_date>)</td>
</tr>
+ <ifeq "<get-var unstable>" "none" "" <group
+ <tr>
+ <td>Unstable Version: </td><td class=heavy><get-var unstable></td><td> (<get-var unstable_date>)</td>
+ </tr>
+ >>
+ <ifeq "<get-var done>" "100" "" <group
+ <tr>
+ <td>Done:</td><td colspan=2><pbar width=100 pdone="<get-var done>" cdone="#b5b5b0" ctext="#f5f5f0" ctodo="#996666"></td>
+ </tr>
+ >>
</table>
<restore stable>
<restore unstable>
@@ -164,3 +195,12 @@
<restore done>
</define-tag>
+<define-tag pkg_author>
+<preserve name>
+<preserve mail>
+<set-var %attributes>
+ <get-var name> <<a href="mailto:<get-var mail>"><get-var mail></a>><br>
+<restore name>
+<restore mail>
+</define-tag>
+
|