From 088a8d629e11c01e227ca2dc0c80894f1e1db997 Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Wed, 15 Jan 2014 21:11:02 +0200 Subject: [PATCH] Add Account page --- lib/Gruntmaster/Page.pm | 1 + lib/Gruntmaster/Page/Account.pm | 58 +++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 lib/Gruntmaster/Page/Account.pm diff --git a/lib/Gruntmaster/Page.pm b/lib/Gruntmaster/Page.pm index 9fad273..d3d2506 100644 --- a/lib/Gruntmaster/Page.pm +++ b/lib/Gruntmaster/Page.pm @@ -35,6 +35,7 @@ sub declaregen{ my $contest = qr,(?:ct/$component/)?,; declaregen Index => qr,^index$,; declaregen Learn => qr,^learn$,; + declaregen Account => qr,^account$,; declaregen Ct => qr,^ct/index$,; declaregen 'Ct::Entry' => qr,^ct/$component/index$,; declaregen St => qr,^ct/$component/log/st$,; diff --git a/lib/Gruntmaster/Page/Account.pm b/lib/Gruntmaster/Page/Account.pm new file mode 100644 index 0000000..6842b12 --- /dev/null +++ b/lib/Gruntmaster/Page/Account.pm @@ -0,0 +1,58 @@ +package Gruntmaster::Page::Account; + +use 5.014000; +use strict; +use warnings; +use parent qw/Exporter/; +our @EXPORT_OK = qw/generate/; +our $VERSION = '0.001'; + +use constant TITLE => 'Account'; + +use HTML::Template::Compiled; +use Gruntmaster::Page::Common qw/header footer/; + +my %templates = ( + en => <<'HTML', +
+ +

Register

+
+Username:
+
+Password:
+
+Confirm password:
+
+Full name:
+
+Email:
+
+Town:
+
+University (full name):
+
+ +
+ +

Change password

+
+Old password:
+
+New password:
+
+Confirm new password:
+
+ +
+HTML +); + +$templates{$_} = header($_, TITLE) . $templates{$_} for keys %templates; +$templates{$_} .= footer $_ for keys %templates; + +sub generate{ + HTML::Template::Compiled->new(scalarref => \$templates{$_[1]})->output +} + +1 -- 2.39.2