PostText/templates/page/captcha.html.ep

32 lines
1.1 KiB
Plaintext
Raw Permalink Normal View History

2023-08-05 07:14:09 +00:00
% layout 'default';
% title 'CAPTCHA';
% content_for open_graph => begin
<meta property="og:type" content="website">
<meta property="og:title" content="<%= title %>">
<meta property="og:description" content="What are you?">
% end
% content_for twitter_card => begin
<meta name="twitter:title" content="<%= title %>">
<meta name="twitter:description" content="What are you?">
% end
<h2 class="page-title"><%= title %></h2>
<form method="post" class="form-body">
<div class="form-field">
<% if (my $error = validation->error('answer')) { =%>
2023-08-05 19:22:02 +00:00
<p class="field-with-error">Should be a single number between
<%= $error->[2] %> and <%= $error->[3] %>.</p>
2023-08-05 07:14:09 +00:00
<% } =%>
2023-08-05 20:04:37 +00:00
<%= label_for answer => "What Roman numeral is this?: $roman_numeral" %>
2023-08-05 19:25:32 +00:00
<%= number_field 'answer', (
2023-10-16 02:30:01 +00:00
id => 'answer',
min => 1,
max => 9,
required => undef,
autofocus => undef
2023-08-05 07:14:09 +00:00
) %>
</div>
<%= hidden_field number => $roman_numeral, id => 'number' %>
2024-08-16 00:30:47 +00:00
<%= csrf_field %>
2023-08-05 07:14:09 +00:00
<button type="submit" class="form-button">Answer</button>
</form>