File Coverage

blib/lib/HTML/FormHandler/Widget/Wrapper/TableInline.pm
Criterion Covered Total %
statement 19 19 100.0
branch 3 4 75.0
condition 1 3 33.3
subroutine 4 4 100.0
pod 0 1 0.0
total 27 31 87.1


line stmt bran cond sub pod time code
1             package HTML::FormHandler::Widget::Wrapper::TableInline;
2             # ABSTRACT: wrapper class for table layout that doesn't wrap compound fields
3             $HTML::FormHandler::Widget::Wrapper::TableInline::VERSION = '0.40067';
4 1     1   671 use Moose::Role;
  1         1  
  1         8  
5             with 'HTML::FormHandler::Widget::Wrapper::Base';
6 1     1   3594 use HTML::FormHandler::Render::Util ('process_attrs');
  1         2  
  1         7  
7              
8             sub wrap_field {
9 3     3 0 4 my ( $self, $result, $rendered_widget ) = @_;
10              
11 3 100       8 return $rendered_widget if $self->has_flag('is_compound');
12              
13 2         8 my $output = "\n<tr" . process_attrs($self->wrapper_attributes($result)) . ">";
14 2 50 33     51 if ( $self->do_label && length( $self->label ) > 0 ) {
15 2         8 $output .= '<td>' . $self->do_render_label($result) . '</td>';
16             }
17 2         5 $output .= '<td>';
18 2         3 $output .= $rendered_widget;
19 2         62 $output .= qq{\n<span class="error_message">$_</span>} for $result->all_errors;
20 2         4 $output .= "</td></tr>\n";
21              
22 2         8 return $output;
23             }
24              
25 1     1   249 use namespace::autoclean;
  1         1  
  1         8  
26             1;
27              
28             __END__
29              
30             =pod
31              
32             =encoding UTF-8
33              
34             =head1 NAME
35              
36             HTML::FormHandler::Widget::Wrapper::TableInline - wrapper class for table layout that doesn't wrap compound fields
37              
38             =head1 VERSION
39              
40             version 0.40067
41              
42             =head1 AUTHOR
43              
44             FormHandler Contributors - see HTML::FormHandler
45              
46             =head1 COPYRIGHT AND LICENSE
47              
48             This software is copyright (c) 2016 by Gerda Shank.
49              
50             This is free software; you can redistribute it and/or modify it under
51             the same terms as the Perl 5 programming language system itself.
52              
53             =cut