summaryrefslogtreecommitdiff
path: root/lib/VNWeb/Elm.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2020-05-12 10:25:02 +0200
committerYorhel <git@yorhel.nl>2020-05-12 10:25:02 +0200
commit13d14259b08ab9d40f14bfc3edabb816e3ea8d20 (patch)
tree973e82be525997b212bd2f495af0731b57cd3c2d /lib/VNWeb/Elm.pm
parentc18d0d12829c4c42910d66a4d7fbb035ba8dc7ac (diff)
Char::Edit: Initial rewrite of the character edit form, general info first
Diffstat (limited to 'lib/VNWeb/Elm.pm')
-rw-r--r--lib/VNWeb/Elm.pm15
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/VNWeb/Elm.pm b/lib/VNWeb/Elm.pm
index 5d287851..247f21b7 100644
--- a/lib/VNWeb/Elm.pm
+++ b/lib/VNWeb/Elm.pm
@@ -172,12 +172,12 @@ sub def_validation {
my %v = $obj->html5_validation();
$data .= def $name, 'List (Html.Attribute msg)', '[ '.join(', ',
- $v{required} ? 'A.required True' : (),
- $v{minlength} ? "A.minlength $v{minlength}" : (),
- $v{maxlength} ? "A.maxlength $v{maxlength}" : (),
- $v{min} ? 'A.min '.string($v{min}) : (),
- $v{max} ? 'A.max '.string($v{max}) : (),
- $v{pattern} ? 'A.pattern '.string($v{pattern}) : ()
+ $v{required} ? 'A.required True' : (),
+ defined $v{minlength} ? "A.minlength $v{minlength}" : (),
+ defined $v{maxlength} ? "A.maxlength $v{maxlength}" : (),
+ defined $v{min} ? 'A.min '.string($v{min}) : (),
+ defined $v{max} ? 'A.max '.string($v{max}) : (),
+ $v{pattern} ? 'A.pattern '.string($v{pattern}) : ()
).']' if !$obj->{keys};
$data;
}
@@ -367,6 +367,9 @@ sub write_types {
$data .= def resolutions=> 'List (String, String)' => list map tuple(string $_, string +($RESOLUTION{$_}{cat}?"$RESOLUTION{$_}{cat} / ":'').$RESOLUTION{$_}{txt}), keys %RESOLUTION;
$data .= def voiced => 'List (Int, String)' => list map tuple($_, string $VOICED{$_}{txt}), keys %VOICED;
$data .= def animated => 'List (Int, String)' => list map tuple($_, string $ANIMATED{$_}{txt}), keys %ANIMATED;
+ $data .= def genders => 'List (String, String)' => list map tuple(string $_, string $GENDER{$_}), keys %GENDER;
+ $data .= def cupSizes => 'List (String, String)' => list map tuple(string $_, string $CUP_SIZE{$_}), keys %CUP_SIZE;
+ $data .= def bloodTypes => 'List (String, String)' => list map tuple(string $_, string $BLOOD_TYPE{$_}), keys %BLOOD_TYPE;
$data .= def curYear => Int => (gmtime)[5]+1900;
write_module Types => $data;