our @ISA=qw(My::Web Exporter);
+sub ENTRIES { return top_dir_disk()."/project/CVS/Entries"; }
+sub ENTRIES_LOG { return top_dir_disk()."/project/CVS/Entries.Log"; }
+
+
sub print_project ($)
{
my($class,$ListItem)=@_;
- print "<h1>".$ListItem->{"name"}."</h1>\n";
+ print "<h1>".$W->{"title"}."</h1>\n";
print $ListItem->{"description"};
print "<hr />\n";
my @table=(
{"key"=>"maintenance","text"=>"State","format"=>sub ($) {
my %known=(
"active"=>"Ready to use. Project is now actively developed.",
- "ready"=>"Ready to use although no longer being actively developed.",
+ "ready"=>"Ready to use. Maintained.",
+ "pending"=>"Patch is ready to be applied to the mainstream.",
"dead"=>"Dead code, no longer supported.",
"merge"=>"Functions belong to existing other project.",
"obsolete"=>"Obsoleted.",
}
return join(" ",@r);
}},
+ {"key"=>"aminet","text"=>a_href('http://www.aminet.net/','Aminet'),"format"=>sub ($) {
+ return join(" ",
+ a_href('http://www.aminet.net/'.$_[0].".lha",$_[0].".lha"),
+ "(".a_href('http://www.aminet.net/'.$_[0].".readme","readme").")");
+ }},
{"key"=>qr(^download\b),"text"=>sub ($) {
$_[0]=~s/^download//;
$_[0]=~s/^-/ /;
return "Download".$_[0];
},
"format"=>sub ($) {
- my $r;
- if ($_[0]=~m#^[a-z]+://#) {
- $r=a_href($_[0],CGI::escapeHTML($_[0]));
- }
- else {
- $r=a_href($_[0],CGI::escapeHTML(File::Basename::basename($_[0])));
- my $size=(stat $_[0])[7];
- die "Cannot stat \"".$_[0]."\": $!" if !defined $size;
- if ($size>=1024*1024) { $size=int($size/(1024*1024))." MB"; }
- elsif ($size>=1024 ) { $size=int($size/(1024 ))." KB"; }
- else { $size=int($size )." B"; }
- $r.=" ($size)";
- }
- return $r;
+ return a_href($_[0],CGI::escapeHTML(File::Basename::basename($_[0])));
}},
{"key"=>qr(^link\b),"text"=>sub ($) {
$_[0]=~s/^link-//;
return $_[0];
},
"format"=>sub ($) {
- return a_href($_[0],CGI::escapeHTML($_[0]));
+ return($_[0]=~/^<a\b/ ? $_[0] : a_href($_[0],CGI::escapeHTML($_[0])));
}},
{"key"=>qr(^cvs\b),"text"=>sub ($) {
$_[0]=~s/^cvs//;
["Download CVS snapshot" ,
$W->{"project_viewcvs"}.$val."/".File::Basename::basename($val).".tar.gz?tarball=1"
.(!$branch ? "" : '&only_with_tag='.$branch)],
- ["CVS ChangeLog" ,$W->{"top_dir"}."/project/ChangeLog.txt.pl?cvs=$val"])));
+ ["CVS ChangeLog" ,top_dir()."/project/ChangeLog.txt.pl?cvs=$val"])));
}},
{"key"=>"ownership","text"=>"Ownership"},
- {"key"=>"sponsorship","text"=>"Sponsoring Company"},
+ {"key"=>"sponsorship","text"=>"Sponsorship"},
{"key"=>"language","text"=>"Programming language","format"=>sub ($) {
return a_href("http://java.sun.com/",CGI::escapeHTML($_[0]))
if $_[0]=~/^Java\b/;
my($class,%args)=@_;
my $ListItem={ project_arr_to_hash(@{$args{"ListItem"}}) };
- my $name=$ListItem->{"name"};
- $name=~s#<a\s[^>]*>([^<]*)</a>#$1#g;
my $W=$class->init(
- "title"=>$name,
+ "title"=>$ListItem->{"name"}.": ".$ListItem->{"summary"},
%args,
"head_css"=>($args{"head_css"} || "")."
table.print_project td { vertical-align: top; }
",
+ "WebConfig::heading_novskip"=>1,
);
$class->heading();
+ print $class->platforms($ListItem->{"platform"});
$class->print_project({ %$ListItem });
return $W;
}
+sub item_hash_read ()
+{
+ my %dirs;
+ for my $ENTRIES (ENTRIES(),ENTRIES_LOG()) {
+ local *E;
+ next if !open E,$ENTRIES;
+ while (<E>) {
+ chomp;
+ do { $dirs{$1}=1; next; } if m#^(?:A )?D/([^/]*)/#;
+ next if m#^/([^/]*)/# ;
+ next if /^D$/;
+ warn "File $ENTRIES contains invalid line \"$_\": $!";
+ }
+ close E;
+ }
+
+ my %item;
+ for my $dir (keys(%dirs)) {
+ Wrequire "project::${dir}::ListItem";
+ my $item=eval('\@project::'.$dir.'::ListItem::ListItem');
+ do { warn "Broken project/$dir/ListItem.pm"; next; } if !defined $item;
+ $item{$dir}={ My::Project::project_arr_to_hash(@$item) };
+ }
+ return %item;
+}
+
+our @platforms=(
+ "unixuser"=>"GNU/Linux",
+ "unixdevel"=>"GNU/Linux Development",
+ "web"=>"Web",
+ "amiga"=>"Amiga",
+ "w32"=>"MS-Windows",
+ "dos"=>"MS-DOS",
+ "patch"=>"Patches",
+ );
+
+sub views ($$)
+{
+my($class,$view_selected)=@_;
+
+ my $view=sub ($$)
+ {
+ my($current,$href,$content)=@_;
+
+ return a_href($href,$content) if $current ne $view_selected;
+ return "<b>".$content."</b> (current)";
+ };
+
+ return <<"HERE";
+<h1>Project List of @{[ a_href 'http://www.jankratochvil.net/','Jan Kratochvil' ]}</h1>
+
+<ul>
+ <li>@{[ &{$view}('Detailed' ,top_dir().'/project/','Detailed project listing per platform') ]}</li>
+ <li>@{[ &{$view}('BriefPlatform',top_dir().'/project/List.html.pl?platform=platform',
+ 'Brief project listing per platform') ]}</li>
+ <li>@{[ &{$view}('BriefUnified' ,top_dir().'/project/List.html.pl',
+ 'Unified brief project listing') ]}</li>
+</ul>
+@{[ vskip "1ex" ]}
+HERE
+}
+
+sub platforms ($;$)
+{
+my($class,$platform_selected)=@_;
+
+ my $r="";
+ $r.='<table border="0" align="center"><tr>'."\n";
+ $r.='<td>Projects: </td>';
+ $r.='<td>';
+ $r.='<table border="1" align="center" style="border-collapse: collapse; border-style: solid;">'."\n";
+ $r.='<tr>'."\n";
+ my @platforms=@platforms;
+ while (@platforms) {
+ my $platform_sym =shift @platforms;
+ my $platform_name=shift @platforms;
+ my $chosen=($platform_selected && $platform_selected eq $platform_sym);
+ $r.='<td style="padding: 5px;">';
+ $r.=a_href((!$platform_selected ? "" : top_dir()."/project/").'#'.$platform_sym,$platform_name,
+ "attr"=>($chosen
+ ? 'style="text-decoration: underline; font-weight: bold;"'
+ : 'style="text-decoration: inherit; /* revoke underline */"'));
+ $r.="</td>\n";
+ }
+ $r.='</tr>'."\n";
+ $r.='</table>'."\n";
+ $r.='</td>'."\n";
+ $r.='</tr></table>'."\n";
+ $r.=vskip "1ex";
+ $r;
+}
+
1;