| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package HTML::FormHandler::Widget::Field::Repeatable; |
|
2
|
|
|
|
|
|
|
# ABSTRACT: repeatable field widget |
|
3
|
|
|
|
|
|
|
$HTML::FormHandler::Widget::Field::Repeatable::VERSION = '0.40067'; |
|
4
|
28
|
|
|
28
|
|
19264
|
use Moose::Role; |
|
|
28
|
|
|
|
|
46
|
|
|
|
28
|
|
|
|
|
259
|
|
|
5
|
|
|
|
|
|
|
with 'HTML::FormHandler::Widget::Field::Compound'; |
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
has 'wrap_repeatable_element_method' => ( |
|
9
|
|
|
|
|
|
|
traits => ['Code'], |
|
10
|
|
|
|
|
|
|
is => 'ro', |
|
11
|
|
|
|
|
|
|
isa => 'CodeRef', |
|
12
|
|
|
|
|
|
|
handles => { 'wrap_repeatable_element' => 'execute_method' }, |
|
13
|
|
|
|
|
|
|
); |
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub render_subfield { |
|
16
|
51
|
|
|
51
|
0
|
65
|
my ( $self, $result, $subfield ) = @_; |
|
17
|
|
|
|
|
|
|
|
|
18
|
51
|
|
|
|
|
1207
|
my $subresult = $result->field( $subfield->name ); |
|
19
|
|
|
|
|
|
|
|
|
20
|
51
|
0
|
0
|
|
|
114
|
return "" unless $subresult |
|
|
|
|
33
|
|
|
|
|
|
21
|
|
|
|
|
|
|
or ( $self->has_flag( "is_repeatable") |
|
22
|
|
|
|
|
|
|
and $subfield->name < $self->num_when_empty |
|
23
|
|
|
|
|
|
|
); |
|
24
|
|
|
|
|
|
|
|
|
25
|
51
|
|
|
|
|
179
|
my $output = $subfield->render($subresult); |
|
26
|
51
|
100
|
|
|
|
1661
|
if ( $self->wrap_repeatable_element_method ) { |
|
27
|
2
|
|
|
|
|
49
|
$output = $self->wrap_repeatable_element($output, $subfield->name); |
|
28
|
|
|
|
|
|
|
} |
|
29
|
51
|
|
|
|
|
223
|
return $output; |
|
30
|
|
|
|
|
|
|
} |
|
31
|
|
|
|
|
|
|
|
|
32
|
28
|
|
|
28
|
|
108087
|
use namespace::autoclean; |
|
|
28
|
|
|
|
|
45
|
|
|
|
28
|
|
|
|
|
256
|
|
|
33
|
|
|
|
|
|
|
1; |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
__END__ |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=pod |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=encoding UTF-8 |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 NAME |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
HTML::FormHandler::Widget::Field::Repeatable - repeatable field widget |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head1 VERSION |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
version 0.40067 |
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
Renders a repeatable field |
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 AUTHOR |
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
FormHandler Contributors - see HTML::FormHandler |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
This software is copyright (c) 2016 by Gerda Shank. |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
|
62
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=cut |