guestbook-ng/templates/sign.html.ep

41 lines
1.3 KiB
Plaintext
Raw Permalink Normal View History

% 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>
<form method="post">
<div class="name field">
<%= label_for name => 'Name' %>
2022-01-09 02:21:22 +00:00
<%= text_field name =>'Anonymous', maxlength => 63, minlength => 1 %>
</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>
<% } =%>
</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>
<% } =%>
</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
<% } =%>
</div>
<%= submit_button 'Sign it', class => 'win95button' %>
</form>