2021-12-05 07:52:31 +00:00
|
|
|
% layout 'default';
|
2021-12-19 22:43:58 +00:00
|
|
|
% title 'Sign';
|
2021-12-12 00:01:43 +00:00
|
|
|
<h2>Sign the Guestbook</h2>
|
2021-12-05 07:52:31 +00:00
|
|
|
<form method="post">
|
2021-12-31 22:58:55 +00:00
|
|
|
<div class="name field">
|
|
|
|
<%= label_for name => 'Name' %>
|
2022-01-09 02:21:22 +00:00
|
|
|
<%= text_field name =>'Anonymous', maxlength => 63, minlength => 1 %>
|
2021-12-31 22:58:55 +00:00
|
|
|
</div>
|
|
|
|
<div class="url field">
|
2022-01-02 02:39:04 +00:00
|
|
|
<%= label_for url => 'Homepage URL' %>
|
2022-01-09 02:21:22 +00:00
|
|
|
<%= text_field 'url', maxlength => 255 %>
|
|
|
|
<% if (my $error = validation->error('url')) { =%>
|
|
|
|
<p class="field-with-error">URL does not appear to be
|
|
|
|
<%= link_to 'RFC 2616',
|
|
|
|
'https://datatracker.ietf.org/doc/html/rfc2616/#section-3.2.2' %>
|
|
|
|
compliant.</p>
|
|
|
|
<% } =%>
|
2021-12-31 22:58:55 +00:00
|
|
|
</div>
|
|
|
|
<div class="message field">
|
2022-01-09 02:21:22 +00:00
|
|
|
<%= label_for message => 'Message' %>
|
|
|
|
<%= text_area 'message',
|
|
|
|
maxlength => 2000,
|
|
|
|
minlength => 2,
|
|
|
|
required => 'true',
|
|
|
|
rows => 6 %>
|
|
|
|
<% if (my $error = validation->error('message')) { =%>
|
|
|
|
<p class="field-with-error">Message must be less than 2,000
|
|
|
|
characters and cannot be blank.</p>
|
|
|
|
<% } =%>
|
2021-12-31 22:58:55 +00:00
|
|
|
</div>
|
|
|
|
<h3>SwaggCAPTCHA™</h3>
|
|
|
|
<div class="captcha field">
|
2022-01-01 03:32:39 +00:00
|
|
|
<% for my $answer (@$answers) { =%>
|
2022-01-09 02:21:22 +00:00
|
|
|
<%= radio_button answer => $answer %>
|
|
|
|
<%= label_for answer =>
|
|
|
|
$answer ? $right_answer_label : pop @$wrong_answer_labels %>
|
2022-01-01 03:32:39 +00:00
|
|
|
<% } =%>
|
2021-12-31 22:58:55 +00:00
|
|
|
</div>
|
|
|
|
<%= submit_button 'Sign it', class => 'win95button' %>
|
2021-12-05 07:52:31 +00:00
|
|
|
</form>
|