line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::Auto::Templates; |
2
|
|
|
|
|
|
|
# ABSTRACT: stores HTML::Auto templates |
3
|
|
|
|
|
|
|
$HTML::Auto::Templates::VERSION = '0.09'; |
4
|
2
|
|
|
2
|
|
6
|
use base qw/Template::Provider/; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
142
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
7
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
41
|
|
7
|
2
|
|
|
2
|
|
5
|
use strict; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
31
|
|
8
|
|
|
|
|
|
|
|
9
|
2
|
|
|
2
|
|
6
|
use File::Basename; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
399
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
my $templates = { |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
'matrix' => <<'EOT' |
14
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
| |
102
|
|
|
|
|
|
|
[% FOREACH i IN cols %] |
103
|
|
|
|
|
|
|
| [% i -%] |
104
|
|
|
|
|
|
|
[% END %] |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
[% i_c = 0 %] |
107
|
|
|
|
|
|
|
[% FOREACH i IN vals %] |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
| [% lines.shift -%] |
110
|
|
|
|
|
|
|
[% j_c = 0 %] |
111
|
|
|
|
|
|
|
[% FOREACH j IN i %] |
112
|
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
[% class = "" %] |
114
|
|
|
|
|
|
|
[% IF diagonal AND i_c == j_c %] |
115
|
|
|
|
|
|
|
[% class = "mid" %] |
116
|
|
|
|
|
|
|
[% END %] |
117
|
|
|
|
|
|
|
[% IF more.$i_c.$j_c %] |
118
|
|
|
|
|
|
|
[% class = "more_info " _ class %] |
119
|
|
|
|
|
|
|
[% END %] |
120
|
|
|
|
|
|
|
[% IF attrs.$i_c.$j_c.class %] |
121
|
|
|
|
|
|
|
[% class = class _ " " _ attrs.$i_c.$j_c.class %] |
122
|
|
|
|
|
|
|
[% END %] |
123
|
|
|
|
|
|
|
[% attrs.$i_c.$j_c.delete('class') %] |
124
|
|
|
|
|
|
|
[% IF class.length != 0 %] class="[% class %]" [% END %] |
125
|
|
|
|
|
|
|
[% FOREACH att IN attrs.$i_c.$j_c.keys %] |
126
|
|
|
|
|
|
|
[% att %]="[% attrs.$i_c.$j_c.$att %]" |
127
|
|
|
|
|
|
|
[% END %] |
128
|
|
|
|
|
|
|
>[% IF myformat %][% j | format(myformat) %][% ELSE %][% j %][% END %] |
129
|
|
|
|
|
|
|
[% IF more.$i_c.$j_c %] |
130
|
|
|
|
|
|
|
[% more.$i_c.$j_c %] |
131
|
|
|
|
|
|
|
[% END %] |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
[% j_c = j_c + 1 %] |
134
|
|
|
|
|
|
|
[% END %] |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
[% i_c = i_c + 1 %] |
137
|
|
|
|
|
|
|
[% END %] |
138
|
|
|
|
|
|
|
| |
139
|
|
|
|
|
|
|
EOT |
140
|
|
|
|
|
|
|
, |
141
|
|
|
|
|
|
|
'h' => <<'EOT' |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
[% FOREACH i IN list %] |
144
|
|
|
|
|
|
|
[% i %] |
145
|
|
|
|
|
|
|
[% END %] |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
EOT |
149
|
|
|
|
|
|
|
, |
150
|
|
|
|
|
|
|
'v' => <<'EOT' |
151
|
|
|
|
|
|
|
[% FOREACH i IN list %] |
152
|
|
|
|
|
|
|
[% i %] |
153
|
|
|
|
|
|
|
[% END %] |
154
|
|
|
|
|
|
|
EOT |
155
|
|
|
|
|
|
|
}; |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
sub _template_modified { |
158
|
10
|
|
|
10
|
|
84710
|
my($self,$path) = @_; |
159
|
|
|
|
|
|
|
|
160
|
10
|
|
|
|
|
20
|
return 1; |
161
|
|
|
|
|
|
|
} |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
sub _template_content { |
164
|
5
|
|
|
5
|
|
21
|
my ($self, $path) = @_; |
165
|
|
|
|
|
|
|
|
166
|
5
|
|
|
|
|
208
|
$path = basename($path);; |
167
|
5
|
50
|
|
|
|
17
|
$self->debug("get $path") if $self->{DEBUG}; |
168
|
|
|
|
|
|
|
|
169
|
5
|
|
|
|
|
11
|
my $data = $templates->{$path}; |
170
|
5
|
|
|
|
|
11
|
my $error = "error: $path not found"; |
171
|
5
|
|
|
|
|
6
|
my $mod_date = 1; |
172
|
|
|
|
|
|
|
|
173
|
5
|
|
|
|
|
13
|
return $data; |
174
|
|
|
|
|
|
|
} |
175
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
1; |
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
__END__ |