line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::Shakan::Renderer::HTML; |
2
|
22
|
|
|
22
|
|
118
|
use strict; |
|
22
|
|
|
|
|
55
|
|
|
22
|
|
|
|
|
778
|
|
3
|
22
|
|
|
22
|
|
113
|
use warnings; |
|
22
|
|
|
|
|
41
|
|
|
22
|
|
|
|
|
710
|
|
4
|
22
|
|
|
22
|
|
107
|
use Mouse; |
|
22
|
|
|
|
|
37
|
|
|
22
|
|
|
|
|
580
|
|
5
|
22
|
|
|
22
|
|
26005
|
use HTML::Escape (); |
|
22
|
|
|
|
|
38640
|
|
|
22
|
|
|
|
|
3838
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
has 'id_tmpl' => ( |
8
|
|
|
|
|
|
|
is => 'ro', |
9
|
|
|
|
|
|
|
isa => 'Str', |
10
|
|
|
|
|
|
|
default => 'id_%s', |
11
|
|
|
|
|
|
|
); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub render { |
14
|
9
|
|
|
9
|
0
|
17
|
my ($self, $form) = @_; |
15
|
|
|
|
|
|
|
|
16
|
9
|
|
|
|
|
15
|
my @res; |
17
|
9
|
|
|
|
|
34
|
for my $field ($form->fields) { |
18
|
11
|
100
|
|
|
|
65
|
unless ($field->id) { |
19
|
9
|
|
|
|
|
108
|
$field->id(sprintf($self->id_tmpl(), $field->{name})); |
20
|
|
|
|
|
|
|
} |
21
|
11
|
50
|
|
|
|
79
|
if ($field->label) { |
22
|
11
|
|
|
|
|
70
|
push @res, sprintf( q{}, |
23
|
|
|
|
|
|
|
$field->{id}, HTML::Escape::escape_html( $field->{label} ) ); |
24
|
|
|
|
|
|
|
} |
25
|
11
|
|
|
|
|
65
|
push @res, $form->widgets->render( $form, $field ); |
26
|
|
|
|
|
|
|
} |
27
|
9
|
|
|
|
|
63
|
join '', @res; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
22
|
|
|
22
|
|
147
|
no Mouse; |
|
22
|
|
|
|
|
49
|
|
|
22
|
|
|
|
|
156
|
|
31
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
32
|
|
|
|
|
|
|
__END__ |