X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FGruntmaster%2FPage%2FUs%2FEntry.pm;fp=lib%2FGruntmaster%2FPage%2FUs%2FEntry.pm;h=5d493ba9fb02518ba51e1e1831f2821eb9ac1c96;hb=4aa8ba862bf3a79362df73c3d1e8707e8135af23;hp=0000000000000000000000000000000000000000;hpb=4d44768e04bf89f1908e23edbe162a66ffcee02f;p=plack-app-gruntmaster.git diff --git a/lib/Gruntmaster/Page/Us/Entry.pm b/lib/Gruntmaster/Page/Us/Entry.pm new file mode 100644 index 0000000..5d493ba --- /dev/null +++ b/lib/Gruntmaster/Page/Us/Entry.pm @@ -0,0 +1,38 @@ +package Gruntmaster::Page::Us::Entry; + +use 5.014000; +use strict; +use warnings; +use parent qw/Exporter/; +our @EXPORT_OK = qw/generate/; +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]}); + + $htc->param(name => user_name); + $htc->param(town => user_town); + $htc->param(university => user_university); + $htc->param(level => user_level); + $htc->output; +} + +1