line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package SyForm::View; |
2
|
|
|
|
|
|
|
BEGIN { |
3
|
6
|
|
|
6
|
|
3951
|
$SyForm::View::AUTHORITY = 'cpan:GETTY'; |
4
|
|
|
|
|
|
|
} |
5
|
|
|
|
|
|
|
# ABSTRACT: Container for SyForm::Results and SyForm::ViewField |
6
|
|
|
|
|
|
|
$SyForm::View::VERSION = '0.103'; |
7
|
6
|
|
|
6
|
|
42
|
use Moo; |
|
6
|
|
|
|
|
16
|
|
|
6
|
|
|
|
|
41
|
|
8
|
6
|
|
|
6
|
|
1912
|
use Tie::IxHash; |
|
6
|
|
|
|
|
14
|
|
|
6
|
|
|
|
|
213
|
|
9
|
6
|
|
|
6
|
|
33
|
use Module::Runtime qw( use_module ); |
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
64
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
with qw( |
12
|
|
|
|
|
|
|
MooX::Traits |
13
|
|
|
|
|
|
|
SyForm::ViewRole::Success |
14
|
|
|
|
|
|
|
SyForm::ViewRole::Verify |
15
|
|
|
|
|
|
|
SyForm::ViewRole::HTML |
16
|
|
|
|
|
|
|
SyForm::ViewRole::Bootstrap |
17
|
|
|
|
|
|
|
); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
has results => ( |
20
|
|
|
|
|
|
|
is => 'ro', |
21
|
|
|
|
|
|
|
required => 1, |
22
|
|
|
|
|
|
|
handles => [qw( |
23
|
|
|
|
|
|
|
syform |
24
|
|
|
|
|
|
|
values |
25
|
|
|
|
|
|
|
)], |
26
|
|
|
|
|
|
|
); |
27
|
26
|
|
|
26
|
0
|
249
|
sub has_results { 1 } # results should be optional |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
has field_names => ( |
30
|
|
|
|
|
|
|
is => 'lazy', |
31
|
|
|
|
|
|
|
); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub _build_field_names { |
34
|
0
|
|
|
0
|
|
0
|
my ( $self ) = @_; |
35
|
0
|
|
|
|
|
0
|
return [ map { $_->name } $self->fields->Values ]; |
|
0
|
|
|
|
|
0
|
|
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
has fields => ( |
39
|
|
|
|
|
|
|
is => 'lazy', |
40
|
|
|
|
|
|
|
init_arg => undef, |
41
|
|
|
|
|
|
|
); |
42
|
0
|
|
|
0
|
0
|
0
|
sub viewfields { shift->fields } |
43
|
6
|
|
|
6
|
0
|
2202
|
sub field { shift->fields->FETCH(@_) } |
44
|
0
|
|
|
0
|
0
|
0
|
sub viewfield { shift->fields->FETCH(@_) } |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub _build_fields { |
47
|
3
|
|
|
3
|
|
29
|
my ( $self ) = @_; |
48
|
3
|
|
|
|
|
22
|
my $fields = Tie::IxHash->new; |
49
|
3
|
|
|
|
|
110
|
for my $field ($self->syform->fields->Values) { |
50
|
13
|
50
|
|
|
|
613
|
$fields->Push(map { $_->name, $_ } $field->viewfields_for_view($self)) |
|
13
|
|
|
|
|
5029
|
|
51
|
|
|
|
|
|
|
if $field->can('viewfields_for_view'); |
52
|
|
|
|
|
|
|
} |
53
|
3
|
|
|
|
|
75
|
return $fields; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
1; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
__END__ |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=pod |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head1 NAME |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
SyForm::View - Container for SyForm::Results and SyForm::ViewField |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head1 VERSION |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
version 0.103 |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head1 AUTHOR |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
Torsten Raudssus <torsten@raudss.us> |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
This software is copyright (c) 2014 by Torsten Raudssus. |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
79
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=cut |