+platform
[www.jankratochvil.net.git] / project / Index.html.pl
index 2e42b10..8b67c4b 100755 (executable)
@@ -27,11 +27,8 @@ use warnings;
 
 BEGIN{ open F,"Makefile"; our $top_dir=pop @{[split /\s/,(grep /^top_srcdir/,<F>)[0]]}; eval "use lib '$top_dir'"; close F; }
 use My::Web;
-require 'CGI';
-require 'My::Project';
-
-use constant ENTRIES=>"CVS/Entries";
-use constant ENTRIES_LOG=>"CVS/Entries.Log";
+require CGI;
+Wrequire 'My::Project';
 
 
 My::Web->init(
@@ -45,7 +42,7 @@ my $CGI=CGI->new();
 print <<'HERE';
 <h1>Project List of <a href="mailto:web-www.jankratochvil.net@jankratochvil.net">Jan Kratochvil</a></h1>
 
-<form action="Index.pl" method="get"><p>
+<form action="Index.html.pl" method="get"><p>
 <select name="description_opt" onchange="this.form.submit();">
 HERE
 print '<option value="0"'.(!$CGI->param("description_opt") ? ' selected="selected"' : '').'>only list</option>'."\n";
@@ -56,27 +53,7 @@ print <<'HERE';
 </p></form>
 HERE
 
-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)) {
-       require "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) };
-       }
+my %item=( My::Project::item_hash_read() );
 
 # $col{"name"}{"show"}=1
 # $col{"name"}{"format"}=sub { "<".$_[0].">"; }
@@ -104,6 +81,10 @@ $col{"license"}{"format"}=sub {
                return $_[0];
                };
 
+$col{"maintenance"}{"format"}=sub {
+               return ($_[0]=~/^([^-]*)/)[0];
+               };
+
 $col{"online-demo"}{"format"}=\&format_url;
 $col{"download"}{"format"}=\&format_url;
 $col{"name"}{""}="Project Name";