]> iEval git - gruntmaster-page.git/blame - lib/Gruntmaster/Page/Account.pm
Add patch_templates to Account.pm
[gruntmaster-page.git] / lib / Gruntmaster / Page / Account.pm
CommitLineData
088a8d62
MG
1package Gruntmaster::Page::Account;
2
3use 5.014000;
4use strict;
5use warnings;
6use parent qw/Exporter/;
7our @EXPORT_OK = qw/generate/;
8our $VERSION = '0.001';
9
10use constant TITLE => 'Account';
11
12use HTML::Template::Compiled;
6eff0ac5 13use Gruntmaster::Page::Common qw/header footer patch_templates/;
088a8d62
MG
14
15my %templates = (
16 en => <<'HTML',
17<div id="result"></div>
18
19<h1>Register</h1>
20<form action="/action/register" method="POST" class="jsform">
21Username:<br>
22<input type="text" name="username" required><br>
23Password:<br>
24<input type="password" name="password" required><br>
25Confirm password:<br>
26<input type="password" name="confirm_password" required><br>
27Full name:<br>
28<input type="text" name="name" required><br>
29Email:<br>
30<input type="email" name="email" required><br>
31Town:<br>
32<input type="text" name="town" required><br>
33University <i>(full name)</i>:<br>
34<input type="text" name="university" required><br>
35<input type="submit" value="Register">
36</form>
37
38<h1>Change password</h1>
39<form action="/action/passwd" method="POST" class="jsform">
40Old password:<br>
41<input type="password" name="password" required><br>
42New password:<br>
43<input type="password" name="new_password" required><br>
44Confirm new password:<br>
45<input type="password" name="confirm_new_password" required><br>
46<input type="submit" value="Change password">
47</form>
48HTML
49);
50
6eff0ac5
MG
51patch_templates %templates, 'account';
52
088a8d62
MG
53$templates{$_} = header($_, TITLE) . $templates{$_} for keys %templates;
54$templates{$_} .= footer $_ for keys %templates;
55
56sub generate{
57 HTML::Template::Compiled->new(scalarref => \$templates{$_[1]})->output
58}
59
601
This page took 0.027608 seconds and 4 git commands to generate.