# $Id$ # List of projects Perl template. # Copyright (C) 2003-2005 Jan Kratochvil # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; exactly version 2 of June 1991 is required # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA package project::Index; require 5.6.0; # at least 'use warnings;' but we need some 5.6.0+ modules anyway our $VERSION=do { my @r=(q$Revision$=~/\d+/g); sprintf "%d.".("%03d"x$#r),@r; }; our $CVS_ID=q$Id$; use strict; use warnings; use My::Web; Wrequire 'project::Lib'; use Carp qw(confess cluck); sub handler { My::Web->init( "title"=>'Project List', "section"=>"Projects", # "rel_up"=>"/", # TODO:homepage # "rel_start"=>"/", # TODO:homepage # Not used if no full listing is done: #"footer_ids"=>0, ); My::Web->heading(); print(project::Lib->views("Detailed")); print(project::Lib->platforms(undef(),"novskip"=>1)); my %item=project::Lib->name_to_hashref(); my %item_unused=%item; my @platforms=@project::Lib::platforms; while (@platforms) { my $platform_sym =shift @platforms; my $platform_name=shift @platforms; print '

'.$platform_name.'

'."\n"; my @projects=sort { ($item{$b}{"priority"} <=> $item{$a}{"priority"}) or (lc($item{$a}{"name"}) cmp lc($item{$b}{"name"})); } map({ $item{$_}{"platform"} ne $platform_sym ? () : ($_); } keys(%item)); for my $project (@projects) { delete $item_unused{$project}; my $t=""; $t.="

".a_href("/project/$project/",$item{$project}{"name"}.": ".$item{$project}{"summary"})."

\n"; $t.="
\n"; $t.=$item{$project}{"description"}; $t.="
\n"; if ($item{$project}{"icon"}) { print rightimg $t, "/project/$project/".$item{$project}{"icon"},$item{$project}{"name"}." Icon","a_href"=>"/project/$project/"; } else { print $t; } } } cluck "INVALID 'platform': $_" for keys(%item_unused); exit; } 1;