X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FGruntmaster%2FPage%2FUs%2FEntry.pm;h=628f9fa2a5d736f1713c9409ee8ae58fb7ef97b0;hb=d0fd48fc9587e9190cb3cde1ee7a2a5db12dbbb6;hp=5d493ba9fb02518ba51e1e1831f2821eb9ac1c96;hpb=4aa8ba862bf3a79362df73c3d1e8707e8135af23;p=plack-app-gruntmaster.git diff --git a/lib/Gruntmaster/Page/Us/Entry.pm b/lib/Gruntmaster/Page/Us/Entry.pm index 5d493ba..628f9fa 100644 --- a/lib/Gruntmaster/Page/Us/Entry.pm +++ b/lib/Gruntmaster/Page/Us/Entry.pm @@ -3,36 +3,19 @@ package Gruntmaster::Page::Us::Entry; use 5.014000; use strict; use warnings; -use parent qw/Exporter/; -our @EXPORT_OK = qw/generate/; +use Gruntmaster::Page::Base us_entry => ''; +our @ISA = qw/Gruntmaster::Page::Base/; our $VERSION = '0.001'; -use HTML::Template::Compiled; -use Gruntmaster::Data qw/users user_name user_town user_university user_level/; -use Gruntmaster::Page::Common qw/cook_templates reload_templates/; - -my %orig_templates = ( - en => <<'HTML', -

-Town:
-University:
-Level: -HTML -); - -my %templates = cook_templates %orig_templates, us_entry => ''; - -sub generate{ - %templates = cook_templates %orig_templates, us_entry => '' if reload_templates; - $_[0] =~ m,^us/([^/]+)\.html$,; - local $_ = $1; - my $htc = HTML::Template::Compiled->new(scalarref => \$templates{$_[1]}); +sub _generate{ + my ($self, $htc, $lang, $env, $us) = @_; + debug $env => "language is '$lang', user is '$us'"; + local $_ = $us; $htc->param(name => user_name); $htc->param(town => user_town); $htc->param(university => user_university); $htc->param(level => user_level); - $htc->output; } 1