Finally merged the branch 'apache20'(+'apache2') back to the main trunk.
[www.jankratochvil.net.git] / resume / ResumeJanKratochvil.pm
old mode 100755 (executable)
new mode 100644 (file)
similarity index 83%
rename from resume/Resume-JanKratochvil.html.pl
rename to resume/ResumeJanKratochvil.pm
index ee58c32..41ef8f8
@@ -1,8 +1,6 @@
-#! /usr/bin/perl
-# 
 # $Id$
 # Resume page Perl template.
-# Copyright (C) 2003 Jan Kratochvil <project-www.jankratochvil.net@jankratochvil.net>
+# Copyright (C) 2003-2005 Jan Kratochvil <project-www.jankratochvil.net@jankratochvil.net>
 # 
 # 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
@@ -26,40 +24,52 @@ $CVS_ID=q$Id$;
 use strict;
 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 Crypt::Rot13;
-Wrequire 'My::Project';
+Wrequire 'project::Lib';
+
 
+sub Contact($)
+{
+my($self)=@_;
+
+       return (
+               "Name"    =>"Jan Kratochvil",
+               "English" =>"technical: fluent, general: communicable",
+               "Born"    =>"1979",
+               "Sex"     =>"male",
+               "Licenses"=>"motorcycle, car",
+               "eMail"   =>(map({ a_href("mailto:$_",$_); } 'job@jankratochvil.net'))[0],
+               "Projects"=>a_href('http://www.jankratochvil.net/project/'),
+               "Resume"  =>a_href('http://www.jankratochvil.net/resume/')."<br />"
+                          ."[ ".a_href('/resume/ResumeJanKratochvil.pdf','PDF')
+                          ."| ".a_href('/resume/ResumeJanKratochvil.txt','text')
+                          ."]",
+               "OpenPGP" =>a_href('/pgp-JanKratochvil.txt','')
+                           .'pub  1024D/26A802B2 2004-01-17'."<br />"
+                           .'sub  2048g/A74DF86D 2004-01-17 [expires: 2007-01-16]'
+       );
+}
 
+sub handler
+{
 my $W=My::Web->init(
-               "__PACKAGE__"=>__PACKAGE__,
                "title"=>"Resume",
                "section"=>"Resume",
                "heading"=>0,
                "footer"=>0,
-               "head_css"=>"
-td { vertical-align: top; }
-table { border-collapse: collapse; border-style: solid; border-width: 1px; margin: 8px; }
-A[href] { text-decoration: inherit; /* revoke underline */ }
-A[href].project { text-decoration: underline; }
-.platform { font-style: italic; white-space: nowrap; }
-table.referees td.com { text-align: center; }
-.techs { white-space: nowrap; }
-caption  { caption-side: top; }
-table.jobs td { padding: 1ex; }
-",
+               "css_push"=>"/resume/ResumeJanKratochvil.css",
                "args_check"=>{
                                "referees"=>'', # Do not bother with '^(?:(?i)referees)?$'
                                "print"=>'^(?:print)?$',
                                },
+               "http_safe"=>1, # For our anti-robot POST request.
                );
 $W->{"args"}{"Wabs"}=1;
 My::Web->heading();
 
 
-my %item=( My::Project::item_hash_read() );
+my %item=project::Lib->name_to_hashref();
 my @itemnames=sort {
                ($item{$b}{"priority"} <=> $item{$a}{"priority"})
                or (lc($item{$a}->{"name"}) cmp lc($item{$b}->{"name"}));
@@ -129,26 +139,24 @@ my($arg)=@_;
 
 
 my $uClinux=a_href 'http://www.uclinux.com/','uClinux';
-my $mailme=(map({ a_href("mailto:$_",$_); } 'job@jankratochvil.net'))[0];
 my $now=(localtime())[5]+1900;
 
 print <<"HERE";
-<table width="100%" style="border-style: none;"><tr><td align="center"><table>
-<tr><td class="tab-head">Name    </td><td>Jan Kratochvil</td></tr>
-<tr><td class="tab-head">English </td><td>technical: fluent, general: communicable</td></tr>
-<tr><td class="tab-head">Born    </td><td>1979</td></tr>
-<tr><td class="tab-head">Sex     </td><td>male</td></tr>
-<tr><td class="tab-head">Licenses</td><td>motorcycle, car</td></tr>
-<tr><td class="tab-head">eMail   </td><td>$mailme</td></tr>
-<tr><td class="tab-head">Projects</td><td>@{[ a_href('http://www.jankratochvil.net/project/') ]}</td></tr>
-<tr><td class="tab-head">Resume  </td><td>@{[ a_href('http://www.jankratochvil.net/resume/') ]}<br />
-                                          [ @{[ a_href '/resume/Resume-JanKratochvil.pdf','PDF' ]}
-                                          | @{[ a_href '/resume/Resume-JanKratochvil.txt','text' ]} ]</td></tr>
-<tr><td class="tab-head">OpenPGP </td><td style="font-family: monospace; text-align: left;">@{[ a_href '/pgp-JanKratochvil.txt',''
-               .'pub  1024D/26A802B2 2004-01-17'.'<br />'
-               .'sub  2048g/A74DF86D 2004-01-17 [expires: 2007-01-16]'
-               ]}</span></td></tr>
-</table></td></tr></table>
+<table border="0" class="margin-center">
+HERE
+my @contact=__PACKAGE__->Contact();
+while (@contact) {
+       my $key=shift @contact;
+       my $val=shift @contact;
+       print <<"HERE";
+<tr>
+       <td class="tab-head">$key</td>
+       <td@{[ ($key ne "OpenPGP" ? '' : ' style="font-family: monospace; text-align: left;"') ]}>$val</td>
+</tr>
+HERE
+       }
+print <<"HERE";
+</table>
 
 @{[ vskip "3ex" ]}
 
@@ -156,7 +164,9 @@ print <<"HERE";
 <caption>Fulltime Jobs</caption>
 <tr><th>Date</th><th>Company</th>
                <th>Description</th></tr>
-<tr><td>2005/04-now</td><td class="com">@{[ a_href 'http://www.valinux.co.jp/','VA Linux Systems Japan' ]}</td>
+<tr><td>2005/04-now</td><td class="com">@{[
+                                               a_href_cc {""=>'http://www.valinux.co.jp/en/',
+                                                        "JP"=>'http://www.valinux.co.jp/'},'VA Linux Systems Japan' ]}</td>
                <td>@{[ a_href 'http://www.kernel.org/','Linux kernel' ]}
                                                based development</td></tr>
 <tr><td>2004/01-11</td><td class="com">@{[ a_href 'http://www.sun.com/','Sun Microsystems' ]}</td>
@@ -280,11 +290,11 @@ if (lc($W->{"args"}{"referees"}) ne "referees") {
        print <<"HERE";
                <tr><td style="padding: 10px;" colspan="2">
                        <hr />
-                       <form method="post" action="@{[ top_dir $W->{"resume_url"} ]}">
-                               <p>Enter the word '<b>referees</b>' (without quotes) to disclose e-mail addresses:</p>
-                               <input type="text" size="15" name="referees" value="@{[ CGI::escapeHTML($W->{"args"}{"referees"}) ]}" />
-                               <input type="submit" value="Submit" />
-                               <p>(spambot protection)</p>
+                       <form action="@{[ uri_escaped(path_web $W->{"resume_url"}) ]}" @{[ form_method "post" ]}>
+                               <p>Enter the word '<b>referees</b>' (without quotes) to disclose e-mail addresses:<br />
+                               <input type="text" size="15" name="referees" value="@{[ escapeHTML($W->{"args"}{"referees"}) ]}" /><br />
+                               <input type="submit" value="Submit" /><br />
+                               (spambot protection)</p>
                        </form>
                </td></tr>
 HERE
@@ -338,9 +348,10 @@ print <<"HERE";
                Detailed listing available at: @{[ a_href 'http://www.jankratochvil.net/projects/' ]}
        </td></tr>
 </thead>
-<tr><th>Platform</th><th>Available Free Projects</th></tr>
+<tbody>
+       <tr><th>Platform</th><th>Available Free Projects</th></tr>
 HERE
-       my @platforms=@My::Project::platforms;
+       my @platforms=@project::Lib::platforms;
        while (@platforms) {
                my $platform_sym =shift @platforms;
                my $platform_name=shift @platforms;
@@ -350,8 +361,11 @@ HERE
                print "</tr>\n";
                }
 print <<"HERE";
+</tbody>
 </table>
 HERE
 
 
-My::Web->footer();
+exit;
+}
+1;