Add Account page
authorMarius Gavrilescu <marius@ieval.ro>
Wed, 15 Jan 2014 19:11:02 +0000 (21:11 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Wed, 15 Jan 2014 19:11:02 +0000 (21:11 +0200)
lib/Gruntmaster/Page.pm
lib/Gruntmaster/Page/Account.pm [new file with mode: 0644]

index 9fad273e81393639ae9324afad70c89fc332d940..d3d25066accaaa17ba53591b76e0755338f413a9 100644 (file)
@@ -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 (file)
index 0000000..6842b12
--- /dev/null
@@ -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',
+<div id="result"></div>
+
+<h1>Register</h1>
+<form action="/action/register" method="POST" class="jsform">
+Username:<br>
+<input type="text" name="username" required><br>
+Password:<br>
+<input type="password" name="password" required><br>
+Confirm password:<br>
+<input type="password" name="confirm_password" required><br>
+Full name:<br>
+<input type="text" name="name" required><br>
+Email:<br>
+<input type="email" name="email" required><br>
+Town:<br>
+<input type="text" name="town" required><br>
+University <i>(full name)</i>:<br>
+<input type="text" name="university" required><br>
+<input type="submit" value="Register">
+</form>
+
+<h1>Change password</h1>
+<form action="/action/passwd" method="POST" class="jsform">
+Old password:<br>
+<input type="password" name="password" required><br>
+New password:<br>
+<input type="password" name="new_password" required><br>
+Confirm new password:<br>
+<input type="password" name="confirm_new_password" required><br>
+<input type="submit" value="Change password">
+</form>
+HTML
+);
+
+$templates{$_}  = header($_, TITLE) . $templates{$_} for keys %templates;
+$templates{$_} .= footer $_ for keys %templates;
+
+sub generate{
+  HTML::Template::Compiled->new(scalarref => \$templates{$_[1]})->output
+}
+
+1
This page took 0.012442 seconds and 4 git commands to generate.