Typo fix.
[www.jankratochvil.net.git] / product / Index.pm
1 # $Id$
2 # List of products Perl template.
3 # Copyright (C) 2005 Jan Kratochvil <project-www.jankratochvil.net@jankratochvil.net>
4
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; exactly version 2 of June 1991 is required
8
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
18
19 package product::Index;
20 require 5.6.0;  # at least 'use warnings;' but we need some 5.6.0+ modules anyway
21 our $VERSION=do { my @r=(q$Revision$=~/\d+/g); sprintf "%d.".("%03d"x$#r),@r; };
22 our $CVS_ID=q$Id$;
23 use strict;
24 use warnings;
25
26 use My::Web;
27 Wrequire 'product::Lib';
28 use Carp qw(confess cluck);
29
30
31 sub handler
32 {
33 my $W=My::Web->init(
34                 "title"=>'Product List',
35                 "section"=>"Products",
36 #               "rel_up"=>"/",  # TODO:homepage
37 #               "rel_start"=>"/",       # TODO:homepage
38                 "css_push"=>"/product/Lib.css",
39                 "footer_ids"=>0,
40                 "no_job"=>1,
41                 );
42 My::Web->heading();
43
44
45 my %item=product::Lib->name_to_hashref();
46
47 print <<"HERE";
48 <table border="0" width="100%" class="product-list">
49 HERE
50
51 for my $product (product::Lib->products_sorted()) {
52         print <<"HERE";
53         <tr>
54                 <td align="center">
55                         @{[
56                                 img "/product/$product/".$item{$product}{"icon"},$item{$product}{"name"}." Icon",
57                                                 "a_href"=>"/product/$product/"
58                         ]}
59                 </td>
60                 <td>&nbsp;&nbsp;</td>
61                 <td align="left">
62                         <h3>@{[ a_href "/product/$product/",$item{$product}{"name"}.": ".$item{$product}{"summary"} ]}</h3>
63                         <blockquote>
64                                 @{[ $item{$product}{"description"} ]}
65                         </blockquote>
66                 </td>
67         </tr>
68 HERE
69         }
70
71 print <<"HERE";
72 </table>
73 HERE
74
75
76 exit;
77 }
78 1;