--- /dev/null
+<h1>Register</h1>
+<form action="/action/register" method="POST" role="form">
+<div class="form-group"><label for="r_username">Username</label><input type="text" class="form-control" id="r_username" name="username" required></div>
+<div class="form-group"><label for="r_password">Password</label><input type="password" class="form-control" id="r_password" name="password" required></div>
+<div class="form-group"><label for="r_confirm_password">Confirm password</label><input type="password" class="form-control" id="r_confirm_password" name="confirm_password" required></div>
+<div class="form-group"><label for="r_name">Full name</label><input type="text" class="form-control" id="r_name" name="name" required></div>
+<div class="form-group"><label for="r_email">Email</label><input type="email" class="form-control" id="r_email" name="email" required></div>
+<div class="form-group"><label for="r_phone">Phone</label><input type="tel" class="form-control" id="r_phone" name="phone" required></div>
+<div class="form-group"><label for="r_town">Town</label><input type="text" class="form-control" id="r_town" name="town" required></div>
+<div class="form-group"><label for="r_university">Institution</label><input type="text" class="form-control" id="r_university" name="university" required></div>
+<div class="form-group"><label for="r_level">Level</label><select id="level" name="level" class="form-control"> <option>Highschool</option> <option>Undergraduate</option> <option>Master</option> <option>Doctorate</option> <option>Other</option> </select></div>
+<input type="submit" class="btn btn-default" value="Submit">
+</form>
+
+<h1>Change password</h1>
+<form action="/action/passwd" method="POST" class="jsform" role="form">
+<div class="form-group"><label for="ch_password">Old password</label><input type="password" id="ch_password" name="password" class="form-control" required></div>
+<div class="form-group"><label for="ch_new_password">New password</label><input type="password" id="ch_new_password" name="new_password" class="form-control" required></div>
+<div class="form-group"><label for="ch_confirm_new_password">Confirm new password</label><input type="password" id="ch_confirm_new_password" name="confirm_new_password" class="form-control" required></div>
+<input type="submit" class="btn btn-default" value="Change password">
+</form>
--- /dev/null
+Gruntmaster 6000
\ No newline at end of file
padding: 0 15px;
}
-.list-group-item {
+.list-group-item, .form-control {
max-width: 30em;
}
no if $] >= 5.017011, warnings => 'experimental::smartmatch';
our $VERSION = '5999.000_001';
+use File::Slurp qw/read_file/;
use HTTP::Negotiate qw/choose/;
use Plack::Request;
return $obj->generate($format, $env->{'psgix.logger'}, map { $_ // '' } @args);
}
+ if ($r->method eq 'GET' || $r->method eq 'HEAD') {
+ my $article = $r->path eq '/' ? '/index' : $r->path;
+ $article = substr $article, 1;
+ $article =~ tr,/,_,;
+ my @variants = grep { !/\.title$/ } <a/$article.*>;
+ if (@variants) {
+ my $lang = choose [ map { [$_, 1, 'text/html', undef, undef, $_, undef] } map { /\.(.+)$/ } @variants ], $r->headers;
+ my $content = read_file "a/$article.$lang";
+ my $title = read_file "a/$article.$lang.title";
+ my $html = Gruntmaster::Page::Base::header($lang, $title) . $content . Gruntmaster::Page::Base::footer($lang);
+ return [200, ['Content-Type' => 'text/html', 'Content-Language' => $lang, 'Vary' => 'Accept-Language'], [$html] ]
+ }
+ }
+
[404, ['Content-Type' => 'text/plain'], ['Not found']]
}