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.40068';
4 1     1   1139 use Moose::Role;
  1         2  
  1         12  
5             with 'HTML::FormHandler::Widget::Wrapper::Base';
6 1     1   5069 use HTML::FormHandler::Render::Util ('process_attrs');
  1         4  
  1         11  
7              
8             sub wrap_field {
9 3     3 0 7 my ( $self, $result, $rendered_widget ) = @_;
10              
11 3 100       12 return $rendered_widget if $self->has_flag('is_compound');
12              
13 2         12 my $output = "\n<tr" . process_attrs($self->wrapper_attributes($result)) . ">";
14 2 50 33     64 if ( $self->do_label && length( $self->label ) > 0 ) {
15 2         13 $output .= '<td>' . $self->do_render_label($result) . '</td>';
16             }
17 2         7 $output .= '<td>';
18 2         9 $output .= $rendered_widget;
19 2         109 $output .= qq{\n<span class="error_message">$_</span>} for $result->all_errors;
20 2         8 $output .= "</td></tr>\n";
21              
22 2         14 return $output;
23             }
24              
25 1     1   337 use namespace::autoclean;
  1         3  
  1         10  
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.40068
41              
42             =head1 AUTHOR
43              
44             FormHandler Contributors - see HTML::FormHandler
45              
46             =head1 COPYRIGHT AND LICENSE
47              
48             This software is copyright (c) 2017 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