Provide better <form /> specification by new: &My:Web::form_method
[www.jankratochvil.net.git] / resume / ResumeJanKratochvil.pm
index b2336d7..41ef8f8 100644 (file)
@@ -25,7 +25,6 @@ use strict;
 use warnings;
 
 use My::Web;
-require CGI;
 require Crypt::Rot13;
 Wrequire 'project::Lib';
 
@@ -43,8 +42,8 @@ my($self)=@_;
                "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/Resume-JanKratochvil.pdf','PDF')
-                          ."| ".a_href('/resume/Resume-JanKratochvil.txt','text')
+                          ."[ ".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 />"
@@ -57,15 +56,14 @@ sub handler
 my $W=My::Web->init(
                "title"=>"Resume",
                "section"=>"Resume",
-               "heading"=>undef(),
-               "footer"=>undef(),
-               "head"=><<"HERE",
-<link rel="stylesheet" type="text/css" href="@{[ uri_escaped(path_web "/resume/ResumeJanKratochvil.css") ]}" />
-HERE
+               "heading"=>0,
+               "footer"=>0,
+               "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();
@@ -144,7 +142,7 @@ my $uClinux=a_href 'http://www.uclinux.com/','uClinux';
 my $now=(localtime())[5]+1900;
 
 print <<"HERE";
-<table width="100%" style="border-style: none;"><tr><td align="center"><table>
+<table border="0" class="margin-center">
 HERE
 my @contact=__PACKAGE__->Contact();
 while (@contact) {
@@ -158,7 +156,7 @@ while (@contact) {
 HERE
        }
 print <<"HERE";
-</table></td></tr></table>
+</table>
 
 @{[ vskip "3ex" ]}
 
@@ -166,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>
@@ -290,9 +290,9 @@ if (lc($W->{"args"}{"referees"}) ne "referees") {
        print <<"HERE";
                <tr><td style="padding: 10px;" colspan="2">
                        <hr />
-                       <form method="post" action="@{[ uri_escaped(path_web $W->{"resume_url"}) ]}">
+                       <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="@{[ CGI::escapeHTML($W->{"args"}{"referees"}) ]}" /><br />
+                               <input type="text" size="15" name="referees" value="@{[ escapeHTML($W->{"args"}{"referees"}) ]}" /><br />
                                <input type="submit" value="Submit" /><br />
                                (spambot protection)</p>
                        </form>
@@ -366,6 +366,6 @@ print <<"HERE";
 HERE
 
 
-My::Web->footer();
+exit;
 }
 1;