More template cleanup for HTML validation

This commit is contained in:
swag 2023-05-09 21:15:16 -04:00
parent 079910ad68
commit dcbec40d0c
10 changed files with 20 additions and 15 deletions

View File

@ -4,11 +4,11 @@
<form method="post">
<div class="email field">
<%= label_for email => 'Email' %>
<%= email_field 'email' %>
<%= email_field email => (id => 'email') %>
</div>
<div class="password field">
<%= label_for password => 'Password' %>
<%= password_field 'password' %>
<%= password_field password => (id => 'password') %>
</div>
<%= submit_button 'Reset' %>
</form>

View File

@ -4,15 +4,15 @@
<form method="post">
<div class="name field">
<%= label_for name => 'Name' %>
<%= text_field 'name' %>
<%= text_field name => (id => 'name') %>
</div>
<div class="email field">
<%= label_for email => 'Email' %>
<%= email_field 'email' %>
<%= email_field email => (id => 'email') %>
</div>
<div class="password field">
<%= label_for password => 'Password' %>
<%= password_field 'password' %>
<%= password_field password => (id => 'password') %>
</div>
<%= submit_button 'Create' %>
</form>

View File

@ -4,7 +4,7 @@
<form method="post">
<div class="email field">
<%= label_for email => 'Email' %>
<%= email_field 'email' %>
<%= email_field email => (id => 'email') %>
</div>
<%= submit_button 'Demote' %>
</form>

View File

@ -4,7 +4,7 @@
<form method="post">
<div class="email field">
<%= label_for email => 'Email' %>
<%= email_field 'email' %>
<%= email_field email => (id => 'email') %>
</div>
<%= submit_button 'Lock' %>
</form>

View File

@ -4,11 +4,11 @@
<form method="post">
<div class="email field">
<%= label_for email => 'Email' %>
<%= email_field 'email' %>
<%= email_field email => (id => 'email') %>
</div>
<div class="password field">
<%= label_for password => 'Password' %>
<%= password_field 'password' %>
<%= password_field password => (id => 'password') %>
</div>
<%= submit_button 'Login' %>
</form>

View File

@ -4,7 +4,7 @@
<form method="post">
<div class="password field">
<%= label_for password => 'Password' %>
<%= password_field 'password' %>
<%= password_field password => (id => 'password') %>
</div>
<%= submit_button 'Reset' %>
</form>

View File

@ -4,7 +4,7 @@
<form method="post">
<div class="email field">
<%= label_for email => 'Email' %>
<%= email_field 'email' %>
<%= email_field email => (id => 'email') %>
</div>
<%= submit_button 'Promote' %>
</form>

View File

@ -4,7 +4,7 @@
<form method="post">
<div class="email field">
<%= label_for email => 'Email' %>
<%= email_field 'email' %>
<%= email_field email => (id => 'email') %>
</div>
<%= submit_button 'Unlock' %>
</form>

View File

@ -5,6 +5,7 @@
<div class="author field">
<%= label_for author => 'Author' %>
<%= text_field author => session->{'author'}, (
id => 'author',
maxlength => 63,
minlength => 1
) %>
@ -15,11 +16,12 @@
<div class="text field">
<%= label_for body => 'Text' %>
<%= text_area body => (
id => 'body',
maxlength => 4000,
minlength => 2,
required => 'true',
required => undef,
rows => 6,
autofocus => 'autofocus'
autofocus => undef
) %>
<% if (my $error = validation->error('body')) { =%>
<p class="field-with-error">Invalid text: Up to 4,000 characters only.</p>

View File

@ -5,6 +5,7 @@
<div class="author field">
<%= label_for author => 'Author' %>
<%= text_field author => session->{'author'}, (
id => 'author',
maxlength => 63,
minlength => 1
) %>
@ -15,9 +16,10 @@
<div class="title field">
<%= label_for title => 'Title' %>
<%= text_field title => (
id => 'title',
maxlength => 127,
minlength => 1,
autofocus => 'autofocus'
autofocus => undef
) %>
<% if (my $error = validation->error('title')) { =%>
<p class="field-with-error">Invalid title: 1 to 127 characters please.</p>
@ -26,6 +28,7 @@
<div class="text field">
<%= label_for body => 'Text' %>
<%= text_area body => (
id => 'body',
maxlength => 4000,
minlength => 2,
required => 'true',