summaryrefslogtreecommitdiff
path: root/lib/VNDB/Util
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2015-09-20 15:12:05 +0200
committerYorhel <git@yorhel.nl>2015-09-20 15:12:05 +0200
commitbb7a7cc178144457d401c3c6479a41788cf681dd (patch)
tree40bd705081da74c2e665d0c7552dad2c34bcb43c /lib/VNDB/Util
parent28681f6b12b1d8958ae1d792bb831120530de15a (diff)
formValidate: Created templates for gtin and editsum fields
Diffstat (limited to 'lib/VNDB/Util')
-rw-r--r--lib/VNDB/Util/FormHTML.pm9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/VNDB/Util/FormHTML.pm b/lib/VNDB/Util/FormHTML.pm
index b994792e..a319ba42 100644
--- a/lib/VNDB/Util/FormHTML.pm
+++ b/lib/VNDB/Util/FormHTML.pm
@@ -31,13 +31,18 @@ sub htmlFormError {
next;
}
my($field, $type, $rule) = @$e;
- li mt '_formerr_required', $field if $type eq 'required';
+ if($type eq 'required') {
+ li; lit mt $field eq 'editsum' ?'_formerr_tpl_editsum' : '_formerr_required', $field; end;
+ }
li mt '_formerr_minlength', $field, $rule if $type eq 'minlength';
li mt '_formerr_maxlength', $field, $rule if $type eq 'maxlength';
li mt '_formerr_enum', $field, join ', ', @$rule if $type eq 'enum';
li mt '_formerr_wrongboard', $rule if $type eq 'wrongboard';
li $rule->[1] if $type eq 'func' || $type eq 'regex';
- li mt "_formerr_tpl_$rule", $field if $type eq 'template';
+ if($type eq 'template') {
+ $rule = 'int' if $rule eq 'num' || $rule eq 'uint';
+ li; lit mt "_formerr_tpl_$rule", $field; end;
+ }
if($type eq 'tagexists') {
li; lit mt '_formerr_tagexists', "/g$rule->{id}", $rule->{name}; end;
}