X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fchatty;a=blobdiff_plain;f=lib%2FChatty%2FForm%2FRoomCreate.pm;fp=lib%2FChatty%2FForm%2FRoomCreate.pm;h=7b6a6bc2c94a7a6a9e6bc5e1bebc482bbfc6186e;hp=0000000000000000000000000000000000000000;hb=6177b7c3d795a2505f95269ab2dd1d4c6f05a525;hpb=65447d848567b9383f01ab73d8d7eb42b9d8844d diff --git a/lib/Chatty/Form/RoomCreate.pm b/lib/Chatty/Form/RoomCreate.pm new file mode 100644 index 0000000..7b6a6bc --- /dev/null +++ b/lib/Chatty/Form/RoomCreate.pm @@ -0,0 +1,16 @@ +package Chatty::Form::RoomCreate; + +use HTML::FormHandler::Moose; +extends 'HTML::FormHandler::Model::DBIC'; +use namespace::autoclean; + +has '+item_class' => (default => 'Room'); +has '+unique_messages' => (default => sub { + {name => 'Room name is already taken'}; +}); + +has_field 'name' => (input_class => 'validate[required]', label => 'Room name', required => 1, unique => 1); +has_field 'submit' => (type => 'Submit', value => 'Create'); + +__PACKAGE__->meta->make_immutable; +1;