guestbook-ng/templates/sign.html.ep
2022-01-08 21:21:22 -05:00

41 lines
1.3 KiB
Plaintext

% layout 'default';
% title 'Sign';
<h2>Sign the Guestbook</h2>
<form method="post">
<div class="name field">
<%= label_for name => 'Name' %>
<%= text_field name =>'Anonymous', maxlength => 63, minlength => 1 %>
</div>
<div class="url field">
<%= label_for url => 'Homepage URL' %>
<%= 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>
<% } =%>
</div>
<div class="message field">
<%= 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>
<% } =%>
</div>
<h3>SwaggCAPTCHA™</h3>
<div class="captcha field">
<% for my $answer (@$answers) { =%>
<%= radio_button answer => $answer %>
<%= label_for answer =>
$answer ? $right_answer_label : pop @$wrong_answer_labels %>
<% } =%>
</div>
<%= submit_button 'Sign it', class => 'win95button' %>
</form>